mlb_gameday 0.0.11 → 0.1.0

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/spec/basic_spec.rb CHANGED
@@ -1,54 +1,54 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "The basic MLB Gameday API object" do
4
- before :all do
5
- @api = MLBGameday::API.new
6
- end
3
+ describe 'The basic MLB Gameday API object' do
4
+ before :all do
5
+ @api = MLBGameday::API.new
6
+ end
7
7
 
8
- it "should be created" do
9
- expect(@api).to_not eq(nil)
10
- end
8
+ it 'should be created' do
9
+ expect(@api).to_not eq(nil)
10
+ end
11
11
 
12
- it "should have 2 leagues" do
13
- expect(@api.leagues.count).to eq(2)
14
- end
12
+ it 'should have 2 leagues' do
13
+ expect(@api.leagues.count).to eq(2)
14
+ end
15
15
 
16
- it "should have 6 divisions" do
17
- expect(@api.divisions.count).to eq(6)
18
- end
16
+ it 'should have 6 divisions' do
17
+ expect(@api.divisions.count).to eq(6)
18
+ end
19
19
 
20
- it "should have 30 teams" do
21
- expect(@api.teams.count).to eq(30)
22
- end
20
+ it 'should have 30 teams' do
21
+ expect(@api.teams.count).to eq(30)
22
+ end
23
23
 
24
- it "should find the Dodgers by initials" do
25
- expect(@api.team("LAD").city).to eq("Los Angeles")
26
- end
24
+ it 'should find the Dodgers by initials' do
25
+ expect(@api.team('LAD').city).to eq('Los Angeles')
26
+ end
27
27
 
28
- it "should find the Dodgers by name" do
29
- expect(@api.team("Dodgers").city).to eq("Los Angeles")
30
- end
28
+ it 'should find the Dodgers by name' do
29
+ expect(@api.team('Dodgers').city).to eq('Los Angeles')
30
+ end
31
31
 
32
- it "should have 5 teams in the Dodgers' division" do
33
- expect(@api.team("Dodgers").division.teams.count).to eq(5)
34
- end
32
+ it 'should have 5 teams in the Dodgers\' division' do
33
+ expect(@api.team('Dodgers').division.teams.count).to eq(5)
34
+ end
35
35
 
36
- it "should have the Astros in the AL... West" do
37
- expect(@api.team("Astros").league.name).to eq("American")
38
- expect(@api.team("Astros").division.name).to eq("West")
39
- end
36
+ it 'should have the Astros in the AL... West' do
37
+ expect(@api.team('Astros').league.name).to eq('American')
38
+ expect(@api.team('Astros').division.name).to eq('West')
39
+ end
40
40
 
41
- it "should find one game for the Dodgers on 2013-04-01" do
42
- dodgers = @api.team("Dodgers")
41
+ it 'should find one game for the Dodgers on 2013-04-01' do
42
+ dodgers = @api.team('Dodgers')
43
43
 
44
- games = @api.find_games(team: dodgers, date: Date.parse("2013-04-01"))
44
+ games = @api.find_games(team: dodgers, date: Date.parse('2013-04-01'))
45
45
 
46
- expect(games.count).to eq(1)
47
- end
46
+ expect(games.count).to eq(1)
47
+ end
48
48
 
49
- it "should find a game by gid" do
50
- game = @api.game("2013_04_01_sfnmlb_lanmlb_1")
49
+ it 'should find a game by gid' do
50
+ game = @api.game('2013_04_01_sfnmlb_lanmlb_1')
51
51
 
52
- expect(game.home_team.name).to eq("Dodgers")
53
- end
52
+ expect(game.home_team.name).to eq('Dodgers')
53
+ end
54
54
  end
data/spec/game_spec.rb CHANGED
@@ -2,48 +2,48 @@ require 'spec_helper'
2
2
 
3
3
  # TODO: Mock or stub out the JSON files
4
4
 
5
- describe "An MLB Gameday Game object" do
6
- before :all do
7
- @api = MLBGameday::API.new
8
-
9
- @game = @api.find_games(team: "LAD", date: Date.parse("2013-04-01")).first
10
- @free_game = @api.game("2013_04_01_slnmlb_arimlb_1")
11
- end
12
-
13
- it "should have two starting pitchers" do
14
- expect(@game.teams.count).to eq(2)
15
- end
16
-
17
- it "should have the correct venue" do
18
- expect(@game.venue).to eq("Dodger Stadium")
19
- end
20
-
21
- it "should start at the correct time for the home team" do
22
- expect(@game.home_start_time).to eq("1:10 PT")
23
- end
24
-
25
- # TODO: Pick another game, LA and SF are both Pacific
26
- it "should start at the correct time for the away team" do
27
- expect(@game.away_start_time).to eq("1:10 PT")
28
- end
29
-
30
- it "should have Clayton Kershaw starting" do
31
- expect(@game.home_pitcher.name).to eq("Clayton Kershaw")
32
- end
33
-
34
- it "should be on Prime Ticket and ESPN in Los Angeles" do
35
- expect(@game.home_tv).to eq("PRIME, ESPN")
36
- end
37
-
38
- it "should be on KNBR 680 in San Francisco" do
39
- expect(@game.away_radio).to eq("KNBR 680")
40
- end
41
-
42
- it "should not be free" do
43
- expect(@game.is_free?).to be_false
44
- end
45
-
46
- it "should have a free game" do
47
- expect(@free_game.is_free?).to be_true
48
- end
5
+ describe 'An MLB Gameday Game object' do
6
+ before :all do
7
+ @api = MLBGameday::API.new
8
+
9
+ @game = @api.find_games(team: 'LAD', date: Date.parse('2013-04-01')).first
10
+ @free_game = @api.game('2013_04_01_slnmlb_arimlb_1')
11
+ end
12
+
13
+ it 'should have two starting pitchers' do
14
+ expect(@game.teams.count).to eq(2)
15
+ end
16
+
17
+ it 'should have the correct venue' do
18
+ expect(@game.venue).to eq('Dodger Stadium')
19
+ end
20
+
21
+ it 'should start at the correct time for the home team' do
22
+ expect(@game.home_start_time).to eq('1:10 PM PT')
23
+ end
24
+
25
+ # TODO: Pick another game, LA and SF are both Pacific
26
+ it 'should start at the correct time for the away team' do
27
+ expect(@game.away_start_time).to eq('1:10 PM PT')
28
+ end
29
+
30
+ it 'should have Clayton Kershaw starting' do
31
+ expect(@game.home_pitcher.name).to eq('Clayton Kershaw')
32
+ end
33
+
34
+ it 'should be on Prime Ticket and ESPN in Los Angeles' do
35
+ expect(@game.home_tv).to eq('PRIME, ESPN')
36
+ end
37
+
38
+ it 'should be on KNBR 680 in San Francisco' do
39
+ expect(@game.away_radio).to eq('KNBR 680')
40
+ end
41
+
42
+ it 'should not be free' do
43
+ expect(@game.free?).to be_false
44
+ end
45
+
46
+ it 'should have a free game' do
47
+ expect(@free_game.is_free?).to be_true
48
+ end
49
49
  end
data/spec/spec_helper.rb CHANGED
@@ -2,6 +2,3 @@ require 'rubygems'
2
2
  require 'bundler/setup'
3
3
 
4
4
  require 'mlb_gameday'
5
-
6
- RSpec.configure do |config|
7
- end
metadata CHANGED
@@ -1,85 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mlb_gameday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Hoffman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-26 00:00:00.000000000 Z
11
+ date: 2015-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httparty
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '0.13'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '0.13'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: nokogiri
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.6'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: chronic
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.10'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.10'
83
97
  description: Access data about games and players from the official MLB Gameday API
84
98
  email:
85
99
  - git@fustrate.com
@@ -87,7 +101,8 @@ executables: []
87
101
  extensions: []
88
102
  extra_rdoc_files: []
89
103
  files:
90
- - .gitignore
104
+ - ".gitignore"
105
+ - ".rubocop.yml"
91
106
  - Gemfile
92
107
  - LICENSE.txt
93
108
  - README.md
@@ -117,17 +132,17 @@ require_paths:
117
132
  - lib
118
133
  required_ruby_version: !ruby/object:Gem::Requirement
119
134
  requirements:
120
- - - '>='
135
+ - - ">="
121
136
  - !ruby/object:Gem::Version
122
137
  version: '0'
123
138
  required_rubygems_version: !ruby/object:Gem::Requirement
124
139
  requirements:
125
- - - '>='
140
+ - - ">="
126
141
  - !ruby/object:Gem::Version
127
142
  version: '0'
128
143
  requirements: []
129
144
  rubyforge_project:
130
- rubygems_version: 2.0.3
145
+ rubygems_version: 2.4.5
131
146
  signing_key:
132
147
  specification_version: 4
133
148
  summary: Fetches gameday data from the MLB Gameday API