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 CHANGED
@@ -1,4 +1,5 @@
1
1
  *.gem
2
+ *.rbc
2
3
  .DS_Store
3
4
  .bundle
4
5
  .yardoc
data/Gemfile.lock CHANGED
@@ -1,9 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mlb (0.4.0)
5
- faraday (~> 0.5.2)
6
- yajl-ruby (~> 0.7.8)
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.2)
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.2)
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:rcov</tt>. If your changes are not 100% covered, go back to step 6.
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
- * [faraday](https://github.com/technoweenie/faraday/)
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
- namespace :spec do
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::Yajl unless raw
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
- Yajl::Parser.parse(file_from_cache("teams.json"))
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
@@ -1,3 +1,3 @@
1
1
  module MLB
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
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.2")
13
- s.add_runtime_dependency("yajl-ruby", "~> 0.7.8")
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
@@ -1,5 +1,11 @@
1
+ require 'simplecov'
2
+ SimpleCov.start do
3
+ add_group 'Libraries', 'lib'
4
+ end
5
+
1
6
  require File.expand_path('../../lib/mlb', __FILE__)
2
7
 
8
+ require 'rspec'
3
9
  require 'webmock/rspec'
4
10
  RSpec.configure do |config|
5
11
  config.include WebMock::API
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
- - 0
8
- - 4
9
- - 0
10
- version: 0.4.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-07 01:00:00 -07:00
17
+ date: 2010-11-10 00:00:00 -08:00
19
18
  default_executable:
20
19
  dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: bundler
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 15
30
- segments:
31
- - 1
32
- - 0
33
- version: "1.0"
34
- type: :development
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: rake
38
- prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 27
45
- segments:
46
- - 0
47
- - 8
48
- version: "0.8"
49
- type: :development
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: rcov
53
- prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
57
- - - ~>
58
- - !ruby/object:Gem::Version
59
- hash: 25
60
- segments:
61
- - 0
62
- - 9
63
- version: "0.9"
64
- type: :development
65
- version_requirements: *id003
66
- - !ruby/object:Gem::Dependency
67
- name: rspec
68
- prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
70
- none: false
71
- requirements:
72
- - - ~>
73
- - !ruby/object:Gem::Version
74
- hash: 1
75
- segments:
76
- - 2
77
- - 1
78
- version: "2.1"
79
- type: :development
80
- version_requirements: *id004
81
- - !ruby/object:Gem::Dependency
82
- name: webmock
83
- prerelease: false
84
- requirement: &id005 !ruby/object:Gem::Requirement
85
- none: false
86
- requirements:
87
- - - ~>
88
- - !ruby/object:Gem::Version
89
- hash: 5
90
- segments:
91
- - 1
92
- - 5
93
- version: "1.5"
94
- type: :development
95
- version_requirements: *id005
96
- - !ruby/object:Gem::Dependency
97
- name: yard
98
- prerelease: false
99
- requirement: &id006 !ruby/object:Gem::Requirement
100
- none: false
101
- requirements:
102
- - - ~>
103
- - !ruby/object:Gem::Version
104
- hash: 7
105
- segments:
106
- - 0
107
- - 6
108
- version: "0.6"
109
- type: :development
110
- version_requirements: *id006
111
- - !ruby/object:Gem::Dependency
112
- name: ZenTest
113
- prerelease: false
114
- requirement: &id007 !ruby/object:Gem::Requirement
115
- none: false
116
- requirements:
117
- - - ~>
118
- - !ruby/object:Gem::Version
119
- hash: 19
120
- segments:
121
- - 4
122
- - 4
123
- version: "4.4"
124
- type: :development
125
- version_requirements: *id007
126
- - !ruby/object:Gem::Dependency
127
- name: faraday
128
- prerelease: false
129
- requirement: &id008 !ruby/object:Gem::Requirement
130
- none: false
131
- requirements:
132
- - - ~>
133
- - !ruby/object:Gem::Version
134
- hash: 15
135
- segments:
136
- - 0
137
- - 5
138
- - 2
139
- version: 0.5.2
140
- type: :runtime
141
- version_requirements: *id008
142
- - !ruby/object:Gem::Dependency
143
- name: yajl-ruby
144
- prerelease: false
145
- requirement: &id009 !ruby/object:Gem::Requirement
146
- none: false
147
- requirements:
148
- - - ~>
149
- - !ruby/object:Gem::Version
150
- hash: 19
151
- segments:
152
- - 0
153
- - 7
154
- - 8
155
- version: 0.7.8
156
- type: :runtime
157
- version_requirements: *id009
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
- - !ruby/object:Gem::Version
200
- hash: 3
201
- segments:
202
- - 0
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
- - !ruby/object:Gem::Version
209
- hash: 23
210
- segments:
211
- - 1
212
- - 3
213
- - 6
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.7
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