goshrine_bot 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/goshrine_bot.gemspec +1 -1
- data/lib/goshrine_bot/cookies.rb +1 -0
- data/lib/goshrine_bot/game.rb +1 -1
- data/lib/goshrine_bot.rb +1 -2
- metadata +6 -5
- data/lib/goshrine_bot/faye_transport_patch.rb +0 -43
data/goshrine_bot.gemspec
CHANGED
@@ -22,7 +22,7 @@ SPEC = Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
s.add_dependency('eventmachine', '>= 0.12.10')
|
24
24
|
s.add_dependency('em-http-request', '=1.0.0.beta.3')
|
25
|
-
s.add_dependency('faye', '>= 0.
|
25
|
+
s.add_dependency('faye', '>= 0.6.0')
|
26
26
|
s.add_dependency('json', '>= 1.5.0')
|
27
27
|
|
28
28
|
s.add_development_dependency "rspec"
|
data/lib/goshrine_bot/cookies.rb
CHANGED
data/lib/goshrine_bot/game.rb
CHANGED
data/lib/goshrine_bot.rb
CHANGED
@@ -7,7 +7,7 @@ require 'logger'
|
|
7
7
|
|
8
8
|
module GoshrineBot
|
9
9
|
|
10
|
-
VERSION = "0.1.
|
10
|
+
VERSION = "0.1.6"
|
11
11
|
|
12
12
|
STDOUT.sync = true
|
13
13
|
|
@@ -18,7 +18,6 @@ module GoshrineBot
|
|
18
18
|
runner
|
19
19
|
game
|
20
20
|
cookies
|
21
|
-
faye_transport_patch
|
22
21
|
faye_auth_ext
|
23
22
|
core_ext/hash
|
24
23
|
].each do |lib|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: goshrine_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Pete Schwamb
|
@@ -10,7 +10,8 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-26 00:00:00 -05:00
|
14
|
+
default_executable:
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: eventmachine
|
@@ -42,7 +43,7 @@ dependencies:
|
|
42
43
|
requirements:
|
43
44
|
- - ">="
|
44
45
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
46
|
+
version: 0.6.0
|
46
47
|
type: :runtime
|
47
48
|
version_requirements: *id003
|
48
49
|
- !ruby/object:Gem::Dependency
|
@@ -91,10 +92,10 @@ files:
|
|
91
92
|
- lib/goshrine_bot/cookies.rb
|
92
93
|
- lib/goshrine_bot/core_ext/hash.rb
|
93
94
|
- lib/goshrine_bot/faye_auth_ext.rb
|
94
|
-
- lib/goshrine_bot/faye_transport_patch.rb
|
95
95
|
- lib/goshrine_bot/game.rb
|
96
96
|
- lib/goshrine_bot/gtp_stdio_client.rb
|
97
97
|
- lib/goshrine_bot/runner.rb
|
98
|
+
has_rdoc: true
|
98
99
|
homepage: http://github.com/ps2/goshrine_bot
|
99
100
|
licenses: []
|
100
101
|
|
@@ -118,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
119
|
requirements: []
|
119
120
|
|
120
121
|
rubyforge_project:
|
121
|
-
rubygems_version: 1.
|
122
|
+
rubygems_version: 1.6.2
|
122
123
|
signing_key:
|
123
124
|
specification_version: 3
|
124
125
|
summary: A client to connect GTP go programs to GoShrine
|
@@ -1,43 +0,0 @@
|
|
1
|
-
require 'em-http'
|
2
|
-
require 'em-http/version'
|
3
|
-
require 'json'
|
4
|
-
require 'uri'
|
5
|
-
|
6
|
-
module Faye
|
7
|
-
|
8
|
-
class HttpTransport < Transport
|
9
|
-
|
10
|
-
def request(message, timeout)
|
11
|
-
retry_block = retry_block(message, timeout)
|
12
|
-
|
13
|
-
content = JSON.unparse(message)
|
14
|
-
params = {
|
15
|
-
:head => {
|
16
|
-
'Content-Type' => 'application/json',
|
17
|
-
'host' => URI.parse(@endpoint).host,
|
18
|
-
'Content-Length' => content.length
|
19
|
-
},
|
20
|
-
:body => content,
|
21
|
-
:timeout => -1 # for em-http-request < 1.0
|
22
|
-
}
|
23
|
-
if EventMachine::HttpRequest::VERSION.split('.')[0].to_i >= 1
|
24
|
-
options = { # for em-http-request >= 1.0
|
25
|
-
:inactivity_timeout => 0, # connection inactivity (post-setup) timeout (0 = disable timeout)
|
26
|
-
}
|
27
|
-
request = EventMachine::HttpRequest.new(@endpoint, options).post(params)
|
28
|
-
else
|
29
|
-
request = EventMachine::HttpRequest.new(@endpoint).post(params)
|
30
|
-
end
|
31
|
-
request.callback do
|
32
|
-
begin
|
33
|
-
receive(JSON.parse(request.response))
|
34
|
-
rescue
|
35
|
-
retry_block.call
|
36
|
-
end
|
37
|
-
end
|
38
|
-
request.errback { retry_block.call }
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
|