Merge pull request #94 from programmiersportgruppe/master
Shutdown WEBrick server used in installed app flow
This commit is contained in:
commit
fda7086f43
|
@ -92,6 +92,7 @@ module Google
|
||||||
:Logger => WEBrick::Log.new(STDOUT, 0),
|
:Logger => WEBrick::Log.new(STDOUT, 0),
|
||||||
:AccessLog => []
|
:AccessLog => []
|
||||||
)
|
)
|
||||||
|
begin
|
||||||
trap("INT") { server.shutdown }
|
trap("INT") { server.shutdown }
|
||||||
|
|
||||||
server.mount_proc '/' do |req, res|
|
server.mount_proc '/' do |req, res|
|
||||||
|
@ -106,6 +107,9 @@ module Google
|
||||||
|
|
||||||
Launchy.open(auth.authorization_uri.to_s)
|
Launchy.open(auth.authorization_uri.to_s)
|
||||||
server.start
|
server.start
|
||||||
|
ensure
|
||||||
|
server.shutdown
|
||||||
|
end
|
||||||
if @authorization.access_token
|
if @authorization.access_token
|
||||||
if storage.respond_to?(:write_credentials)
|
if storage.respond_to?(:write_credentials)
|
||||||
storage.write_credentials(@authorization)
|
storage.write_credentials(@authorization)
|
||||||
|
|
Loading…
Reference in New Issue