Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed the test server logic to open the auth_url in the default bro…

…wser on windows using the "start" command". Also corrected the name misspelling in the license file.

git-svn-id: svn://rubyforge.org/var/svn/rubyhealthvault/trunk@14 5e59f7e3-561f-4167-93e6-46889eec4fca
  • Loading branch information...
commit 98a547f574352532e49826c4caaef15d31d47857 1 parent 153fedb
afarhad authored
Showing with 15 additions and 13 deletions.
  1. +3 −3 LICENSE
  2. +12 −10 spec/support/test_server.rb
View
6 LICENSE
@@ -1,6 +1,6 @@
-RubyHealthVault is copyrighted free software by Danny Coates and Ashhan Farhadtouski. You can redistribute it and/or modify it under
-either the terms of the GPL (see the GPL file), or the conditions
-below:
+RubyHealthVault is copyrighted free software by Danny Coates and Ashkan Farhadtouski.
+You can redistribute it and/or modify it under either the terms of the GPL (see
+the GPL file), or the conditions below:
1. You may make and give away verbatim copies of the source form of the
software without restriction, provided that you duplicate all of the
View
22 spec/support/test_server.rb
@@ -1,9 +1,7 @@
-if RUBY_PLATFORM =~ /(:?mswin|mingw)/ #TODO: what about jruby?
- require 'win32ole'
-end
require 'cgi'
require 'webrick'
require 'thread'
+require File.dirname(__FILE__) + '/../../lib/config'
class TestServer
include WEBrick
@@ -29,14 +27,18 @@ def wait_for_auth
@http_server.shutdown
end
- def open_login
- if RUBY_PLATFORM =~ /(:?mswin|mingw)/
- ie = WIN32OLE.new('InternetExplorer.Application')
- ie.visible = true
- ie.navigate("https://account.healthvault-ppe.com/redirect.aspx?target=AUTH&targetqs=?appid=05a059c9-c309-46af-9b86-b06d42510550%26redirect=http://localhost:7331/testAuth")
+ def open_login # TODO: Figure out how to do this in JRuby
+ config = Configuration.instance
+ auth_url = "#{config.shell_url}/redirect.aspx?target=AUTH&targetqs=?appid=#{config.app_id}%26redirect=http://localhost:7331/testAuth"
+
+ if RUBY_PLATFORM =~ /(:?mswin|mingw)/ # Windows
+ system("start #{auth_url}")
+ elsif RUBY_PLATFORM =~ /darwin/ # Mac (Darwin, really)
+ system("open", auth_url)
else
- system("open","https://account.healthvault-ppe.com/redirect.aspx?target=AUTH&targetqs=?appid=05a059c9-c309-46af-9b86-b06d42510550%26redirect=http://localhost:7331/testAuth")
+ # TODO: Launch the default browser on other platforms.
+ system("firefox", auth_url)
end
end
-
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.