Attempting to fix some Windows issues and update deprecated library calls.

This commit is contained in:
Bob Aman 2011-11-16 11:44:44 +03:00
parent ba38697528
commit e0afbdaf05
2 changed files with 5 additions and 6 deletions

View File

@ -294,13 +294,12 @@ HTML
exit(0) exit(0)
else else
$verifier = nil $verifier = nil
# TODO(bobaman): Cross-platform?
logger = WEBrick::Log.new('/dev/null')
server = WEBrick::HTTPServer.new( server = WEBrick::HTTPServer.new(
:Port => OAUTH_SERVER_PORT, :Port => OAUTH_SERVER_PORT,
:Logger => logger, :Logger => WEBrick::Log.new,
:AccessLog => logger :AccessLog => WEBrick::Log.new
) )
server.logger.level = 0
trap("INT") { server.shutdown } trap("INT") { server.shutdown }
server.mount("/", OAuthVerifierServlet) server.mount("/", OAuthVerifierServlet)
@ -389,7 +388,7 @@ HTML
) )
# Launch browser # Launch browser
Launchy::Browser.run(oauth_client.authorization_uri.to_s) Launchy.open(oauth_client.authorization_uri.to_s)
server.start server.start
oauth_client.code = $verifier oauth_client.code = $verifier

View File

@ -5,7 +5,7 @@ module Google
# TODO(bobaman) # TODO(bobaman)
# Confirm that all of these Windows environments actually have access # Confirm that all of these Windows environments actually have access
# to the `ver` command. # to the `ver` command.
`ver`.sub(/\s*\[Version\s*/, '/').sub(']', '') `ver`.sub(/\s*\[Version\s*/, '/').sub(']', '').strip
elsif RUBY_PLATFORM =~ /darwin/i elsif RUBY_PLATFORM =~ /darwin/i
"Mac OS X/#{`sw_vers -productVersion`}" "Mac OS X/#{`sw_vers -productVersion`}"
else else