mlb 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile.lock +23 -9
- data/README.mkd +3 -3
- data/Rakefile +1 -13
- data/lib/mlb/request.rb +2 -1
- data/lib/mlb/team.rb +3 -1
- data/lib/mlb/version.rb +1 -1
- data/mlb.gemspec +6 -3
- data/spec/spec_helper.rb +6 -0
- metadata +202 -184
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mlb (0.
|
5
|
-
faraday (~> 0.5.
|
6
|
-
|
4
|
+
mlb (0.5.0)
|
5
|
+
faraday (~> 0.5.3)
|
6
|
+
faraday_middleware (~> 0.3.0)
|
7
|
+
multi_json (~> 0.0.5)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: http://rubygems.org/
|
@@ -12,14 +13,20 @@ GEM
|
|
12
13
|
addressable (2.2.2)
|
13
14
|
crack (0.1.8)
|
14
15
|
diff-lcs (1.1.2)
|
15
|
-
faraday (0.5.
|
16
|
+
faraday (0.5.3)
|
16
17
|
addressable (~> 2.2.2)
|
17
18
|
multipart-post (~> 1.0.1)
|
18
19
|
rack (>= 1.1.0, < 2)
|
20
|
+
faraday_middleware (0.3.0)
|
21
|
+
faraday (~> 0.5.3)
|
22
|
+
json (1.4.6)
|
23
|
+
json (1.4.6-java)
|
24
|
+
maruku (0.6.0)
|
25
|
+
syntax (>= 1.0.0)
|
26
|
+
multi_json (0.0.5)
|
19
27
|
multipart-post (1.0.1)
|
20
28
|
rack (1.2.1)
|
21
29
|
rake (0.8.7)
|
22
|
-
rcov (0.9.9)
|
23
30
|
rspec (2.1.0)
|
24
31
|
rspec-core (~> 2.1.0)
|
25
32
|
rspec-expectations (~> 2.1.0)
|
@@ -28,23 +35,30 @@ GEM
|
|
28
35
|
rspec-expectations (2.1.0)
|
29
36
|
diff-lcs (~> 1.1.2)
|
30
37
|
rspec-mocks (2.1.0)
|
38
|
+
simplecov (0.3.7)
|
39
|
+
simplecov-html (>= 0.3.7)
|
40
|
+
simplecov-html (0.3.9)
|
41
|
+
syntax (1.0.0)
|
31
42
|
webmock (1.5.0)
|
32
43
|
addressable (>= 2.2.2)
|
33
44
|
crack (>= 0.1.7)
|
34
|
-
yajl-ruby (0.7.8)
|
35
45
|
yard (0.6.1)
|
36
46
|
|
37
47
|
PLATFORMS
|
48
|
+
java
|
38
49
|
ruby
|
39
50
|
|
40
51
|
DEPENDENCIES
|
41
52
|
ZenTest (~> 4.4)
|
42
53
|
bundler (~> 1.0)
|
43
|
-
faraday (~> 0.5.
|
54
|
+
faraday (~> 0.5.3)
|
55
|
+
faraday_middleware (~> 0.3.0)
|
56
|
+
json (~> 1.4.6)
|
57
|
+
maruku (~> 0.6)
|
44
58
|
mlb!
|
59
|
+
multi_json (~> 0.0.5)
|
45
60
|
rake (~> 0.8)
|
46
|
-
rcov (~> 0.9)
|
47
61
|
rspec (~> 2.1)
|
62
|
+
simplecov (~> 0.3)
|
48
63
|
webmock (~> 1.5)
|
49
|
-
yajl-ruby (~> 0.7.8)
|
50
64
|
yard (~> 0.6)
|
data/README.mkd
CHANGED
@@ -64,7 +64,7 @@ Submitting a Pull Request
|
|
64
64
|
4. Add documentation for your feature or bug fix.
|
65
65
|
5. Run <tt>bundle exec rake doc:yard</tt>. If your changes are not 100% documented, go back to step 4.
|
66
66
|
6. Add specs for your feature or bug fix.
|
67
|
-
7. Run <tt>bundle exec rake spec
|
67
|
+
7. Run <tt>bundle exec rake spec</tt>. If your changes are not 100% covered, go back to step 6.
|
68
68
|
8. Commit and push your changes.
|
69
69
|
9. Submit a pull request. Please do not include changes to the gemspec, version, or history file. (If you want to create your own version for some reason, please do so in a separate commit.)
|
70
70
|
|
@@ -74,11 +74,11 @@ Many thanks to:
|
|
74
74
|
|
75
75
|
* [Bundler](http://gembundler.com/)
|
76
76
|
* [Freebase](http://www.freebase.com/)
|
77
|
-
* [
|
77
|
+
* [Faraday](https://github.com/technoweenie/faraday/)
|
78
78
|
* [Markdown](http://daringfireball.net/projects/markdown/)
|
79
79
|
* [MultiJSON](https://github.com/intridea/multi_json/)
|
80
|
-
* [rcov](https://github.com/relevance/rcov/)
|
81
80
|
* [RSpec](http://relishapp.com/rspec/)
|
81
|
+
* [SimpleCov](https://github.com/colszowka/simplecov)
|
82
82
|
* [SQLite](http://www.sqlite.org/)
|
83
83
|
* [WebMock](https://github.com/bblimke/webmock/)
|
84
84
|
* [YARD](http://yardoc.org/)
|
data/Rakefile
CHANGED
@@ -4,19 +4,7 @@ Bundler::GemHelper.install_tasks
|
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
RSpec::Core::RakeTask.new(:spec)
|
6
6
|
|
7
|
-
|
8
|
-
desc "Run all examples using rcov"
|
9
|
-
RSpec::Core::RakeTask.new(:rcov => :cleanup_rcov_files) do |task|
|
10
|
-
task.rcov = true
|
11
|
-
task.rcov_opts = %[-Ilib -Ispec --exclude "gems/*,features,specs" --text-report --sort coverage]
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
task :cleanup_rcov_files do
|
16
|
-
rm_rf 'coverage'
|
17
|
-
end
|
18
|
-
|
19
|
-
task :default => ["spec:rcov"]
|
7
|
+
task :default => :spec
|
20
8
|
|
21
9
|
namespace :doc do
|
22
10
|
require 'yard'
|
data/lib/mlb/request.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'faraday'
|
2
|
+
require 'faraday_middleware'
|
2
3
|
|
3
4
|
module MLB
|
4
5
|
# @private
|
@@ -15,7 +16,7 @@ module MLB
|
|
15
16
|
|
16
17
|
def self.connection(raw=false)
|
17
18
|
Faraday::Connection.new(:url => 'http://api.freebase.com') do |connection|
|
18
|
-
connection.use Faraday::Response::
|
19
|
+
connection.use Faraday::Response::ParseJson unless raw
|
19
20
|
connection.adapter Faraday.default_adapter
|
20
21
|
end
|
21
22
|
end
|
data/lib/mlb/team.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'multi_json'
|
2
|
+
|
1
3
|
module MLB
|
2
4
|
class Team
|
3
5
|
private_class_method :new
|
@@ -47,7 +49,7 @@ module MLB
|
|
47
49
|
end
|
48
50
|
|
49
51
|
def self.results_from_cache
|
50
|
-
|
52
|
+
MultiJson.decode(file_from_cache("teams.json").read)
|
51
53
|
end
|
52
54
|
|
53
55
|
def self.file_from_cache(file_name)
|
data/lib/mlb/version.rb
CHANGED
data/mlb.gemspec
CHANGED
@@ -3,14 +3,17 @@ require File.expand_path("../lib/mlb/version", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.add_development_dependency("bundler", "~> 1.0")
|
6
|
+
s.add_development_dependency("json", "~> 1.4.6")
|
7
|
+
s.add_development_dependency("maruku", "~> 0.6")
|
6
8
|
s.add_development_dependency("rake", "~> 0.8")
|
7
|
-
s.add_development_dependency("rcov", "~> 0.9")
|
8
9
|
s.add_development_dependency("rspec", "~> 2.1")
|
10
|
+
s.add_development_dependency("simplecov", "~> 0.3")
|
9
11
|
s.add_development_dependency("webmock", "~> 1.5")
|
10
12
|
s.add_development_dependency("yard", "~> 0.6")
|
11
13
|
s.add_development_dependency("ZenTest", "~> 4.4")
|
12
|
-
s.add_runtime_dependency("faraday", "~> 0.5.
|
13
|
-
s.add_runtime_dependency("
|
14
|
+
s.add_runtime_dependency("faraday", "~> 0.5.3")
|
15
|
+
s.add_runtime_dependency("faraday_middleware", "~> 0.3.0")
|
16
|
+
s.add_runtime_dependency("multi_json", "~> 0.0.5")
|
14
17
|
s.authors = ["Erik Michaels-Ober"]
|
15
18
|
s.description = %q{MLB.rb is a Ruby library for retrieving current Major League Baseball players, managers, teams, divisions, and leagues.}
|
16
19
|
s.email = ["sferik@gmail.com"]
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,163 +1,185 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mlb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 15
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
version: 0.
|
6
|
+
- 0
|
7
|
+
- 5
|
8
|
+
- 0
|
9
|
+
version: 0.5.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
|
-
- Erik Michaels-Ober
|
12
|
+
- Erik Michaels-Ober
|
14
13
|
autorequire:
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-11-
|
17
|
+
date: 2010-11-10 00:00:00 -08:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: bundler
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 0
|
30
|
+
version: "1.0"
|
31
|
+
type: :development
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: json
|
35
|
+
prerelease: false
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 1
|
42
|
+
- 4
|
43
|
+
- 6
|
44
|
+
version: 1.4.6
|
45
|
+
type: :development
|
46
|
+
version_requirements: *id002
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: maruku
|
49
|
+
prerelease: false
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
- 6
|
57
|
+
version: "0.6"
|
58
|
+
type: :development
|
59
|
+
version_requirements: *id003
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: rake
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
- 8
|
70
|
+
version: "0.8"
|
71
|
+
type: :development
|
72
|
+
version_requirements: *id004
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: rspec
|
75
|
+
prerelease: false
|
76
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ~>
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
segments:
|
81
|
+
- 2
|
82
|
+
- 1
|
83
|
+
version: "2.1"
|
84
|
+
type: :development
|
85
|
+
version_requirements: *id005
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
name: simplecov
|
88
|
+
prerelease: false
|
89
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
- 3
|
96
|
+
version: "0.3"
|
97
|
+
type: :development
|
98
|
+
version_requirements: *id006
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: webmock
|
101
|
+
prerelease: false
|
102
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ~>
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
segments:
|
107
|
+
- 1
|
108
|
+
- 5
|
109
|
+
version: "1.5"
|
110
|
+
type: :development
|
111
|
+
version_requirements: *id007
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: yard
|
114
|
+
prerelease: false
|
115
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ~>
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
segments:
|
120
|
+
- 0
|
121
|
+
- 6
|
122
|
+
version: "0.6"
|
123
|
+
type: :development
|
124
|
+
version_requirements: *id008
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: ZenTest
|
127
|
+
prerelease: false
|
128
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ~>
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
segments:
|
133
|
+
- 4
|
134
|
+
- 4
|
135
|
+
version: "4.4"
|
136
|
+
type: :development
|
137
|
+
version_requirements: *id009
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: faraday
|
140
|
+
prerelease: false
|
141
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ~>
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
segments:
|
146
|
+
- 0
|
147
|
+
- 5
|
148
|
+
- 3
|
149
|
+
version: 0.5.3
|
150
|
+
type: :runtime
|
151
|
+
version_requirements: *id010
|
152
|
+
- !ruby/object:Gem::Dependency
|
153
|
+
name: faraday_middleware
|
154
|
+
prerelease: false
|
155
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ~>
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
segments:
|
160
|
+
- 0
|
161
|
+
- 3
|
162
|
+
- 0
|
163
|
+
version: 0.3.0
|
164
|
+
type: :runtime
|
165
|
+
version_requirements: *id011
|
166
|
+
- !ruby/object:Gem::Dependency
|
167
|
+
name: multi_json
|
168
|
+
prerelease: false
|
169
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ~>
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
segments:
|
174
|
+
- 0
|
175
|
+
- 0
|
176
|
+
- 5
|
177
|
+
version: 0.0.5
|
178
|
+
type: :runtime
|
179
|
+
version_requirements: *id012
|
158
180
|
description: MLB.rb is a Ruby library for retrieving current Major League Baseball players, managers, teams, divisions, and leagues.
|
159
181
|
email:
|
160
|
-
- sferik@gmail.com
|
182
|
+
- sferik@gmail.com
|
161
183
|
executables: []
|
162
184
|
|
163
185
|
extensions: []
|
@@ -165,60 +187,56 @@ extensions: []
|
|
165
187
|
extra_rdoc_files: []
|
166
188
|
|
167
189
|
files:
|
168
|
-
- .gitignore
|
169
|
-
- .rspec
|
170
|
-
- .yardopts
|
171
|
-
- Gemfile
|
172
|
-
- Gemfile.lock
|
173
|
-
- LICENSE.mkd
|
174
|
-
- README.mkd
|
175
|
-
- Rakefile
|
176
|
-
- autotest/discover.rb
|
177
|
-
- cache/teams.json
|
178
|
-
- lib/mlb.rb
|
179
|
-
- lib/mlb/player.rb
|
180
|
-
- lib/mlb/request.rb
|
181
|
-
- lib/mlb/team.rb
|
182
|
-
- lib/mlb/version.rb
|
183
|
-
- mlb.gemspec
|
184
|
-
- spec/mlb_spec.rb
|
185
|
-
- spec/spec_helper.rb
|
190
|
+
- .gitignore
|
191
|
+
- .rspec
|
192
|
+
- .yardopts
|
193
|
+
- Gemfile
|
194
|
+
- Gemfile.lock
|
195
|
+
- LICENSE.mkd
|
196
|
+
- README.mkd
|
197
|
+
- Rakefile
|
198
|
+
- autotest/discover.rb
|
199
|
+
- cache/teams.json
|
200
|
+
- lib/mlb.rb
|
201
|
+
- lib/mlb/player.rb
|
202
|
+
- lib/mlb/request.rb
|
203
|
+
- lib/mlb/team.rb
|
204
|
+
- lib/mlb/version.rb
|
205
|
+
- mlb.gemspec
|
206
|
+
- spec/mlb_spec.rb
|
207
|
+
- spec/spec_helper.rb
|
186
208
|
has_rdoc: true
|
187
209
|
homepage: http://rubygems.org/gems/mlb
|
188
210
|
licenses: []
|
189
211
|
|
190
212
|
post_install_message:
|
191
213
|
rdoc_options:
|
192
|
-
- --charset=UTF-8
|
214
|
+
- --charset=UTF-8
|
193
215
|
require_paths:
|
194
|
-
- lib
|
216
|
+
- lib
|
195
217
|
required_ruby_version: !ruby/object:Gem::Requirement
|
196
|
-
none: false
|
197
218
|
requirements:
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
version: "0"
|
219
|
+
- - ">="
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
segments:
|
222
|
+
- 0
|
223
|
+
version: "0"
|
204
224
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
|
-
none: false
|
206
225
|
requirements:
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
version: 1.3.6
|
226
|
+
- - ">="
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
segments:
|
229
|
+
- 1
|
230
|
+
- 3
|
231
|
+
- 6
|
232
|
+
version: 1.3.6
|
215
233
|
requirements: []
|
216
234
|
|
217
235
|
rubyforge_project:
|
218
|
-
rubygems_version: 1.3.
|
236
|
+
rubygems_version: 1.3.6
|
219
237
|
signing_key:
|
220
238
|
specification_version: 3
|
221
239
|
summary: MLB.rb is a Ruby library for retrieving current Major League Baseball players, managers, teams, divisions, and leagues.
|
222
240
|
test_files:
|
223
|
-
- spec/mlb_spec.rb
|
224
|
-
- spec/spec_helper.rb
|
241
|
+
- spec/mlb_spec.rb
|
242
|
+
- spec/spec_helper.rb
|