我想在chrome打包的应用程序中使用chrome.identity API,以允许用户使用github进行身份验证.
从应用程序方面来说,我很满意:
chrome.identity.launchWebAuthFlow(
{'url':'https://github.com/login/oauth/authorize?client_id=clientidgoeshere','interactive':true},
functionToTakeRedirectURL
);
Run Code Online (Sandbox Code Playgroud)
但我不确定github端的重定向URL应该是什么.当应用程序处于活动状态时,我会在github应用程序页面上将重定向URL设置为https://appidgoeshere.chromiumapp.org,但我不认为在应用程序运行之前该URL可用.
在编写应用程序时,有人知道在哪里指向重定向?
我正在使用chrome.dart库在Dart中编写应用程序,但我认为如果我使用普通的javascript编写时存在同样的问题.
我测试了我的项目分为多个文件 - test/test_1.rb和test/test_2.rb.
运行'rake test'给出:
$ rake test
ruby -I"lib:test" -I"/foo/rake-0.9.2/lib" "/foo/rake_test_loader.rb" "test/test_general.rb test/test_cv.rb"
/home/rob/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/rake_test_loader.rb:11:in `require': no such file to load -- /home/rob/src/robsyme/bioruby-chado/test/test_general.rb test/test_cv.rb (LoadError)
... #you can guess the rest
Run Code Online (Sandbox Code Playgroud)
注意ruby命令中的最后一个参数:"test/test_general.rb test/test_cv.rb"
如果我删除引号(将最后一个参数拆分为两个参数),测试运行完美.
环境:
$ grep -A4 TestTask Rakefile
Rake::TestTask.new(:test) do |test|
test.libs << 'test'
test.pattern = FileList['test/**/test_*.rb']
test.verbose = true
end
$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
$ gem --version
1.8.10
$ rake --version
rake, version 0.9.2
Run Code Online (Sandbox Code Playgroud)