openfooty 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -57,7 +57,7 @@ module Openfooty
57
57
  protected
58
58
 
59
59
  def default_options
60
- {:api_key => @api_key, :format => :xml}
60
+ {:api_key => @api_key}
61
61
  end
62
62
 
63
63
  def mashup(response)
data/openfooty.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{openfooty}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Johnny Khai Nguyen"]
12
- s.date = %q{2010-06-10}
12
+ s.date = %q{2010-08-12}
13
13
  s.description = %q{Ruby wrapper for the Openfooty API}
14
14
  s.email = %q{johnnyn@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
27
27
  "openfooty.gemspec",
28
28
  "pkg/openfooty-0.1.0.gem",
29
29
  "pkg/openfooty-0.2.0.gem",
30
+ "pkg/openfooty-0.3.0.gem",
30
31
  "tasks/openfooty_tasks.rake",
31
32
  "test/fixtures/league_fixtures.json",
32
33
  "test/fixtures/league_fixtures.xml",
Binary file
@@ -1 +1,226 @@
1
- {"openfooty":{"version":"1.0","response":{"status":"ok"},"fixtures":{"hasMorePages":"true","nextPage":2,"match":[{"match_id":"878771","league":{"id":"72","season_id":"4770","cdata":"World Cup"},"home_team":{"team_id":"2014","cdata":"South Africa"},"away_team":{"team_id":"1497","cdata":"Mexico"},"date":{"ts":"1276264800","cdata":"2010-06-11 14:00:00"},"status":{"cdata":"Fixture"},"ft_score":{"cdata":null},"winner":{"cdata":null}},{"match_id":"878772","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878778","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878777","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878783","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878784","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878790","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878789","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878795","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878796","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878801","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878802","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878808","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878807","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878814","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878813","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878773","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878779","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878780","league":{"id":"72","season_id":"4770","cdata":"World Cup"}},{"match_id":"878774","league":{"id":"72","season_id":"4770","cdata":"World Cup"}}]}}}
1
+
2
+ {
3
+ "openfooty":
4
+ {
5
+ "version":"1.0",
6
+ "response":
7
+ {
8
+ "status":"ok"
9
+ },
10
+ "fixtures":
11
+ {
12
+ "hasMorePages":"true",
13
+ "nextPage":2,
14
+ "match":
15
+ [
16
+ {
17
+ "match_id":"878771",
18
+ "league":
19
+ {
20
+ "id":"72",
21
+ "season_id":"4770",
22
+ "cdata":"World Cup"
23
+ },
24
+ "home_team":
25
+ {
26
+ "team_id":"2014",
27
+ "cdata":"South Africa"
28
+ },
29
+ "away_team":
30
+ {
31
+ "team_id":"1497",
32
+ "cdata":"Mexico"
33
+ },
34
+ "date":
35
+ {
36
+ "ts":"1276264800",
37
+ "cdata":"2010-06-11 14:00:00"
38
+ },
39
+ "status":
40
+ {
41
+ "cdata":"Fixture"
42
+ },
43
+ "ft_score":
44
+ {
45
+ "cdata":null
46
+ },
47
+ "winner":
48
+ {
49
+ "cdata":null
50
+ }
51
+ },
52
+ {
53
+ "match_id":"878772",
54
+ "league":
55
+ {
56
+ "id":"72",
57
+ "season_id":"4770",
58
+ "cdata":"World Cup"
59
+ }
60
+ },
61
+ {
62
+ "match_id":"878778",
63
+ "league":
64
+ {
65
+ "id":"72",
66
+ "season_id":"4770",
67
+ "cdata":"World Cup"
68
+ }
69
+ },
70
+ {
71
+ "match_id":"878777",
72
+ "league":
73
+ {
74
+ "id":"72",
75
+ "season_id":"4770",
76
+ "cdata":"World Cup"
77
+ }
78
+ },
79
+ {
80
+ "match_id":"878783",
81
+ "league":
82
+ {
83
+ "id":"72",
84
+ "season_id":"4770",
85
+ "cdata":"World Cup"
86
+ }
87
+ },
88
+ {
89
+ "match_id":"878784",
90
+ "league":
91
+ {
92
+ "id":"72",
93
+ "season_id":"4770",
94
+ "cdata":"World Cup"
95
+ }
96
+ },
97
+ {
98
+ "match_id":"878790",
99
+ "league":
100
+ {
101
+ "id":"72",
102
+ "season_id":"4770",
103
+ "cdata":"World Cup"
104
+ }
105
+ },
106
+ {
107
+ "match_id":"878789",
108
+ "league":
109
+ {
110
+ "id":"72",
111
+ "season_id":"4770",
112
+ "cdata":"World Cup"
113
+ }
114
+ },
115
+ {
116
+ "match_id":"878795",
117
+ "league":
118
+ {
119
+ "id":"72",
120
+ "season_id":"4770",
121
+ "cdata":"World Cup"
122
+ }
123
+ },
124
+ {
125
+ "match_id":"878796",
126
+ "league":
127
+ {
128
+ "id":"72",
129
+ "season_id":"4770",
130
+ "cdata":"World Cup"
131
+ }
132
+ },
133
+ {
134
+ "match_id":"878801",
135
+ "league":
136
+ {
137
+ "id":"72",
138
+ "season_id":"4770",
139
+ "cdata":"World Cup"
140
+ }
141
+ },
142
+ {
143
+ "match_id":"878802",
144
+ "league":
145
+ {
146
+ "id":"72",
147
+ "season_id":"4770",
148
+ "cdata":"World Cup"
149
+ }
150
+ },
151
+ {
152
+ "match_id":"878808",
153
+ "league":
154
+ {
155
+ "id":"72",
156
+ "season_id":"4770",
157
+ "cdata":"World Cup"
158
+ }
159
+ },
160
+ {
161
+ "match_id":"878807",
162
+ "league":
163
+ {
164
+ "id":"72",
165
+ "season_id":"4770",
166
+ "cdata":"World Cup"
167
+ }
168
+ },
169
+ {
170
+ "match_id":"878814",
171
+ "league":
172
+ {
173
+ "id":"72",
174
+ "season_id":"4770",
175
+ "cdata":"World Cup"
176
+ }
177
+ },
178
+ {
179
+ "match_id":"878813",
180
+ "league":
181
+ {
182
+ "id":"72",
183
+ "season_id":"4770",
184
+ "cdata":"World Cup"
185
+ }
186
+ },
187
+ {
188
+ "match_id":"878773",
189
+ "league":
190
+ {
191
+ "id":"72",
192
+ "season_id":"4770",
193
+ "cdata":"World Cup"
194
+ }
195
+ },
196
+ {
197
+ "match_id":"878779",
198
+ "league":
199
+ {
200
+ "id":"72",
201
+ "season_id":"4770",
202
+ "cdata":"World Cup"
203
+ }
204
+ },
205
+ {
206
+ "match_id":"878780",
207
+ "league":
208
+ {
209
+ "id":"72",
210
+ "season_id":"4770",
211
+ "cdata":"World Cup"
212
+ }
213
+ },
214
+ {
215
+ "match_id":"878774",
216
+ "league":
217
+ {
218
+ "id":"72",
219
+ "season_id":"4770",
220
+ "cdata":"World Cup"
221
+ }
222
+ }
223
+ ]
224
+ }
225
+ }
226
+ }
data/test/helper.rb CHANGED
@@ -1,11 +1,13 @@
1
- require 'rubygems'
2
1
  require 'test/unit'
3
- require 'shoulda'
2
+ require 'pathname'
3
+ require 'rubygems'
4
4
 
5
- require 'redgreen'
5
+ require 'shoulda'
6
6
  require 'matchy'
7
7
  require 'fakeweb'
8
8
 
9
+ begin require 'redgreen'; rescue LoadError; end
10
+
9
11
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
10
12
  $LOAD_PATH.unshift(File.dirname(__FILE__))
11
13
  require 'openfooty'
@@ -9,7 +9,7 @@ class OpenfootyTest < Test::Unit::TestCase
9
9
  end
10
10
 
11
11
  should "return a list of fixtures for given league_id" do
12
- stub_get("/league.getFixtures?league_id=72", "league_fixtures.xml")
12
+ stub_get("http://api.openfooty.org/1.0/league.getFixtures?league_id=72&api_key=openfootyapikey", "league_fixtures.xml")
13
13
  league_fixtures = @client.league("getFixtures", :league_id => 72).openfooty.fixtures.match
14
14
  league_fixtures.size.should == 20
15
15
  league_fixtures.first.home_team.should == 'South Africa'
@@ -17,14 +17,14 @@ class OpenfootyTest < Test::Unit::TestCase
17
17
  end
18
18
 
19
19
  should "return a team squad members for a given team_id" do
20
- stub_get("/team.getSquad?team_id=2281", "team_squad.xml")
20
+ stub_get("http://api.openfooty.org/1.0/team.getSquad?api_key=openfootyapikey&team_id=2281", "team_squad.xml")
21
21
  team_squad = @client.team("getSquad", :team_id => 2281).openfooty.players.player
22
22
  team_squad.size.should == 31
23
23
  team_squad.first.should == 'B. Bradley'
24
24
  end
25
25
 
26
26
  should "return a list of stats for a given match_id" do
27
- stub_get("/match.getStats?match_id=781512", "match_stats.xml")
27
+ stub_get("http://api.openfooty.org/1.0/match.getStats?match_id=781512&api_key=openfootyapikey", "match_stats.xml")
28
28
  match_stats = @client.match("getStats", :match_id => 781512).openfooty.match
29
29
  match_stats.home_team.assists.assist.size.should == 2
30
30
  match_stats.home_team.assists.assist.last.player_name.should == 'T. Cahill'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Johnny Khai Nguyen
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-10 00:00:00 -05:00
17
+ date: 2010-08-12 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -65,6 +65,7 @@ files:
65
65
  - openfooty.gemspec
66
66
  - pkg/openfooty-0.1.0.gem
67
67
  - pkg/openfooty-0.2.0.gem
68
+ - pkg/openfooty-0.3.0.gem
68
69
  - tasks/openfooty_tasks.rake
69
70
  - test/fixtures/league_fixtures.json
70
71
  - test/fixtures/league_fixtures.xml