Attempting to fix some Windows issues and update deprecated library calls.
This commit is contained in:
parent
38e54b7d49
commit
55e101c365
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue