mlb_gameday 0.0.1.alpha1
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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/lib/mlb_gameday.rb +123 -0
- data/lib/mlb_gameday/batter.rb +4 -0
- data/lib/mlb_gameday/division.rb +21 -0
- data/lib/mlb_gameday/game.rb +164 -0
- data/lib/mlb_gameday/league.rb +22 -0
- data/lib/mlb_gameday/pitcher.rb +44 -0
- data/lib/mlb_gameday/player.rb +14 -0
- data/lib/mlb_gameday/team.rb +41 -0
- data/lib/mlb_gameday/version.rb +3 -0
- data/mlb_gameday.gemspec +27 -0
- data/resources/data.yml +391 -0
- data/spec/basic_spec.rb +54 -0
- data/spec/game_spec.rb +45 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/stubs/linescore.json +116 -0
- metadata +138 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: cdae658439dfe994e1f03e2e6c38169be5518fc4
|
4
|
+
data.tar.gz: ad73fcb5ec67661ebd7e60273eb0e99ebeb37c8e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3c3f072edb92e46635ae7c47631503a11956747db40aaea8266f45f8e8f1e3e1d257babc7aa67d44f2303e4644231896c8fee72320a89d13f22be19860835167
|
7
|
+
data.tar.gz: ca178b27d76e3d64122550e8f090a3722961bf9c995f719bc54b5745e2cfe56322cba75986350d9f62ca952348311b79602f08a17e9f66d2bc3647a5d75f82b5
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Steven Hoffman
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# MlbGameday
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'mlb_gameday'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install mlb_gameday
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/mlb_gameday.rb
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'open-uri'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
%w{version league division team game player pitcher batter}.each do |file|
|
7
|
+
require "mlb_gameday/#{file}"
|
8
|
+
end
|
9
|
+
|
10
|
+
module MLBGameday
|
11
|
+
API_URL = "http://gd2.mlb.com/components/game/mlb"
|
12
|
+
|
13
|
+
class API
|
14
|
+
def initialize
|
15
|
+
# File File File File File File File File File File File File File File File
|
16
|
+
@leagues = YAML.load File.open(File.join(File.dirname(File.expand_path(__FILE__)), '../resources/data.yml'))
|
17
|
+
end
|
18
|
+
|
19
|
+
def leagues
|
20
|
+
@leagues
|
21
|
+
end
|
22
|
+
|
23
|
+
def league(name)
|
24
|
+
return name if name.is_a? MLBGameday::League
|
25
|
+
|
26
|
+
@leagues[name]
|
27
|
+
end
|
28
|
+
|
29
|
+
def team(name)
|
30
|
+
return name if name.is_a? MLBGameday::Team
|
31
|
+
|
32
|
+
teams.each do |team|
|
33
|
+
return team if team.names.include? name.downcase
|
34
|
+
end
|
35
|
+
|
36
|
+
nil
|
37
|
+
end
|
38
|
+
|
39
|
+
def teams
|
40
|
+
@teams ||= divisions.map(&:teams).map(&:values).flatten
|
41
|
+
end
|
42
|
+
|
43
|
+
def division(league, name)
|
44
|
+
@leagues[league][name]
|
45
|
+
end
|
46
|
+
|
47
|
+
def divisions
|
48
|
+
@divisions ||= @leagues[:AL].divisions.values + @leagues[:NL].divisions.values
|
49
|
+
end
|
50
|
+
|
51
|
+
def pitcher(id)
|
52
|
+
return nil if id.empty?
|
53
|
+
|
54
|
+
MLBGameday::Pitcher.new(self, fetch_pitcher_xml(id))
|
55
|
+
end
|
56
|
+
|
57
|
+
def batter(id)
|
58
|
+
return nil if id.empty?
|
59
|
+
|
60
|
+
MLBGameday::Batter.new(self, fetch_batter_xml(id))
|
61
|
+
end
|
62
|
+
|
63
|
+
def game(gid)
|
64
|
+
date = /\A(\d+)_(\d+)_(\d+)_/.match(gid)
|
65
|
+
|
66
|
+
MLBGameday::Game.new(self, fetch_gameday_xml(DateTime.new(date[1].to_i, date[2].to_i, date[3].to_i), gid))
|
67
|
+
end
|
68
|
+
|
69
|
+
def find_games(team: nil, date: nil)
|
70
|
+
date = Date.today if date.nil?
|
71
|
+
|
72
|
+
doc = fetch_scoreboard_xml(date)
|
73
|
+
|
74
|
+
if team.nil?
|
75
|
+
doc.xpath("//games/game").map do |game|
|
76
|
+
MLBGameday::Game.new(self, fetch_gameday_xml(date, game.xpath("@gameday_link").first.value))
|
77
|
+
end
|
78
|
+
else
|
79
|
+
team = team(team)
|
80
|
+
|
81
|
+
doc.xpath("//games/game").map do |game|
|
82
|
+
if [game.xpath("@home_name_abbrev").first.value, game.xpath("@away_name_abbrev").first.value].include? team.code
|
83
|
+
MLBGameday::Game.new(self, fetch_gameday_xml(date, game.xpath("@gameday_link")))
|
84
|
+
end
|
85
|
+
end.compact!
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
private
|
90
|
+
|
91
|
+
def fetch_scoreboard_xml(date)
|
92
|
+
Nokogiri::XML(open(API_URL + date.strftime("/year_%Y/month_%m/day_%d/miniscoreboard.xml")))
|
93
|
+
end
|
94
|
+
|
95
|
+
def fetch_gameday_xml(date, gameday_link)
|
96
|
+
Nokogiri::XML(open(API_URL + date.strftime("/year_%Y/month_%m/day_%d/gid_#{ gameday_link }/linescore.xml")))
|
97
|
+
end
|
98
|
+
|
99
|
+
def fetch_batter_xml(id, year: nil)
|
100
|
+
year = Date.today.year if year.nil?
|
101
|
+
|
102
|
+
# We only really want one piece of data from this file...
|
103
|
+
year_data = Nokogiri::XML(open(API_URL + "/year_#{ year }/batters/#{ id }.xml"))
|
104
|
+
|
105
|
+
game = year_data.xpath("//pitching/@game_id").first.value
|
106
|
+
year, month, day, _ = game.split("/")
|
107
|
+
|
108
|
+
Nokogiri::XML(open(MLBGameday::API_URL + "/year_#{ year }/month_#{ month }/day_#{ day }/gid_#{ game.gsub(/[^a-z0-9]/, "_") }/batters/#{ id }.xml"))
|
109
|
+
end
|
110
|
+
|
111
|
+
def fetch_pitcher_xml(id, year: nil)
|
112
|
+
year = Date.today.year if year.nil?
|
113
|
+
|
114
|
+
# We only really want one piece of data from this file...
|
115
|
+
year_data = Nokogiri::XML(open(API_URL + "/year_#{ year }/pitchers/#{ id }.xml"))
|
116
|
+
|
117
|
+
game = year_data.xpath("//pitching/@game_id").first.value
|
118
|
+
year, month, day, _ = game.split("/")
|
119
|
+
|
120
|
+
Nokogiri::XML(open(MLBGameday::API_URL + "/year_#{ year }/month_#{ month }/day_#{ day }/gid_#{ game.gsub(/[^a-z0-9]/, "_") }/pitchers/#{ id }.xml"))
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module MLBGameday
|
2
|
+
class Division
|
3
|
+
def initialize(league, name, teams)
|
4
|
+
@league = league
|
5
|
+
@name = name
|
6
|
+
@teams = teams
|
7
|
+
end
|
8
|
+
|
9
|
+
def league
|
10
|
+
@league
|
11
|
+
end
|
12
|
+
|
13
|
+
def name
|
14
|
+
@name
|
15
|
+
end
|
16
|
+
|
17
|
+
def teams
|
18
|
+
@teams
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,164 @@
|
|
1
|
+
module MLBGameday
|
2
|
+
class Game
|
3
|
+
def initialize(api, data)
|
4
|
+
@api = api
|
5
|
+
@data = data
|
6
|
+
|
7
|
+
@home = @api.team(@data.xpath("//game/@home_name_abbrev").first.value)
|
8
|
+
@away = @api.team(@data.xpath("//game/@away_name_abbrev").first.value)
|
9
|
+
end
|
10
|
+
|
11
|
+
def teams
|
12
|
+
[@home, @away]
|
13
|
+
end
|
14
|
+
|
15
|
+
def home_team
|
16
|
+
@home
|
17
|
+
end
|
18
|
+
|
19
|
+
def away_team
|
20
|
+
@away
|
21
|
+
end
|
22
|
+
|
23
|
+
def venue
|
24
|
+
xpath("//game/@venue")
|
25
|
+
end
|
26
|
+
|
27
|
+
def start_time(team = nil)
|
28
|
+
return "#{ xpath("//game/@away_time") } #{ xpath("//game/@away_time_zone") }" if team == @away
|
29
|
+
|
30
|
+
"#{ xpath("//game/@home_time") } #{ xpath("//game/@home_time_zone") }"
|
31
|
+
end
|
32
|
+
|
33
|
+
# Preview, Pre-Game, In Progress, Final
|
34
|
+
def status
|
35
|
+
@status ||= @data.xpath("//game/@status").first.value
|
36
|
+
end
|
37
|
+
|
38
|
+
# [3, Top/Middle/Bottom/End]
|
39
|
+
def inning
|
40
|
+
[@data.xpath("//game/@inning"), @data.xpath("//game/@inning_state")]
|
41
|
+
end
|
42
|
+
|
43
|
+
def runners
|
44
|
+
first, second, third = [nil, nil, nil]
|
45
|
+
|
46
|
+
[first, second, third]
|
47
|
+
end
|
48
|
+
|
49
|
+
def over?
|
50
|
+
status == "Final"
|
51
|
+
end
|
52
|
+
alias_method :fat_lady_has_sung?, :over?
|
53
|
+
|
54
|
+
def in_progress?
|
55
|
+
status == "In Progress"
|
56
|
+
end
|
57
|
+
|
58
|
+
def home_record
|
59
|
+
[xpath("//game/@home_win"), xpath("//game/@home_loss")].map(&:to_i)
|
60
|
+
end
|
61
|
+
|
62
|
+
def away_record
|
63
|
+
[xpath("//game/@away_win"), xpath("//game/@away_loss")].map(&:to_i)
|
64
|
+
end
|
65
|
+
|
66
|
+
def current_pitcher
|
67
|
+
return nil if !in_progress?
|
68
|
+
|
69
|
+
@api.pitcher xpath("//game/current_pitcher/@id")
|
70
|
+
end
|
71
|
+
|
72
|
+
def opposing_pitcher
|
73
|
+
return nil if !in_progress?
|
74
|
+
|
75
|
+
@api.pitcher xpath("//game/opposing_pitcher/@id")
|
76
|
+
end
|
77
|
+
|
78
|
+
def winning_pitcher
|
79
|
+
return nil if !over?
|
80
|
+
|
81
|
+
@api.pitcher xpath("//game/winning_pitcher/@id")
|
82
|
+
end
|
83
|
+
|
84
|
+
def losing_pitcher
|
85
|
+
return nil if !over?
|
86
|
+
|
87
|
+
@api.pitcher xpath("//game/losing_pitcher/@id")
|
88
|
+
end
|
89
|
+
|
90
|
+
def save_pitcher
|
91
|
+
return nil if !over?
|
92
|
+
|
93
|
+
@api.pitcher xpath("//game/save_pitcher/@id")
|
94
|
+
end
|
95
|
+
|
96
|
+
def score
|
97
|
+
return [0, 0] if !in_progress? && !over?
|
98
|
+
|
99
|
+
[xpath("//game/@home_team_runs"), xpath("//game/@away_team_runs")].map(&:to_i)
|
100
|
+
end
|
101
|
+
|
102
|
+
def home_pitcher
|
103
|
+
case status
|
104
|
+
when "In Progress"
|
105
|
+
# The xpath changes based on which half of the inning it is
|
106
|
+
if xpath("//game/@top_inning") == "Y"
|
107
|
+
opposing_pitcher
|
108
|
+
else
|
109
|
+
current_pitcher
|
110
|
+
end
|
111
|
+
when "Preview", "Warmup", "Pre-Game"
|
112
|
+
@api.pitcher xpath("//game/home_probable_pitcher/@id")
|
113
|
+
when "Final"
|
114
|
+
home, away = score
|
115
|
+
|
116
|
+
if home > away
|
117
|
+
winning_pitcher
|
118
|
+
elsif away > home
|
119
|
+
losing_pitcher
|
120
|
+
else
|
121
|
+
# Spring training games can end in ties, in which case there's really no pitching data
|
122
|
+
# See: http://gd2.mlb.com/components/game/mlb/year_2013/month_03/day_07/gid_2013_03_07_texmlb_lanmlb_1/linescore.xml
|
123
|
+
# This should really give a null object pitcher back
|
124
|
+
nil
|
125
|
+
end
|
126
|
+
else
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
def away_pitcher
|
131
|
+
case status
|
132
|
+
when "In Progress"
|
133
|
+
# The xpath changes based on which half of the inning it is
|
134
|
+
if xpath("//game/@top_inning") == "Y"
|
135
|
+
current_pitcher
|
136
|
+
else
|
137
|
+
opposing_pitcher
|
138
|
+
end
|
139
|
+
when "Preview", "Warmup", "Pre-Game"
|
140
|
+
@api.pitcher xpath("//game/away_probable_pitcher/@id")
|
141
|
+
when "Final"
|
142
|
+
home, away = score
|
143
|
+
|
144
|
+
if home > away
|
145
|
+
losing_pitcher
|
146
|
+
elsif away > home
|
147
|
+
winning_pitcher
|
148
|
+
else
|
149
|
+
# Spring training games can end in ties, in which case there's really no pitching data
|
150
|
+
# See: http://gd2.mlb.com/components/game/mlb/year_2013/month_03/day_07/gid_2013_03_07_texmlb_lanmlb_1/linescore.xml
|
151
|
+
# This should really give a null object pitcher back
|
152
|
+
nil
|
153
|
+
end
|
154
|
+
else
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
private
|
159
|
+
|
160
|
+
def xpath(path)
|
161
|
+
@data.xpath(path).first.value
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module MLBGameday
|
2
|
+
class League
|
3
|
+
def initialize(name, divisions)
|
4
|
+
@name = name
|
5
|
+
@divisions = divisions
|
6
|
+
end
|
7
|
+
|
8
|
+
def name
|
9
|
+
@name
|
10
|
+
end
|
11
|
+
|
12
|
+
def divisions
|
13
|
+
@divisions
|
14
|
+
end
|
15
|
+
|
16
|
+
def division(name)
|
17
|
+
raise "Invalid division" if ![:East, :Central, :West].include?(name)
|
18
|
+
|
19
|
+
@divisions[name]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module MLBGameday
|
2
|
+
class Pitcher < Player
|
3
|
+
def name
|
4
|
+
xpath("//Player//@first_name") + " " + xpath("//Player//@last_name")
|
5
|
+
end
|
6
|
+
|
7
|
+
def era
|
8
|
+
xpath("//Player/season/@era")
|
9
|
+
end
|
10
|
+
|
11
|
+
def wins
|
12
|
+
xpath("//Player/season/@w")
|
13
|
+
end
|
14
|
+
|
15
|
+
def losses
|
16
|
+
xpath("//Player/season/@l")
|
17
|
+
end
|
18
|
+
|
19
|
+
def innings
|
20
|
+
xpath("//Player/season/@ip")
|
21
|
+
end
|
22
|
+
|
23
|
+
def saves
|
24
|
+
xpath("//Player/season/@sv")
|
25
|
+
end
|
26
|
+
|
27
|
+
def whip
|
28
|
+
xpath("//Player/season/@whip")
|
29
|
+
end
|
30
|
+
|
31
|
+
def strikeouts
|
32
|
+
xpath("//Player/season/@so")
|
33
|
+
end
|
34
|
+
|
35
|
+
def walks
|
36
|
+
xpath("//Player/season/@bb")
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns a Nokogiri::XML object
|
40
|
+
def data
|
41
|
+
@data
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module MLBGameday
|
2
|
+
class Team
|
3
|
+
def initialize(opts = {})
|
4
|
+
@name = opts[:name]
|
5
|
+
@city = opts[:city]
|
6
|
+
@league = opts[:league]
|
7
|
+
@division = opts[:division]
|
8
|
+
@names = opts[:names]
|
9
|
+
@code = opts[:code]
|
10
|
+
end
|
11
|
+
|
12
|
+
# So we don't get huge printouts
|
13
|
+
def inspect
|
14
|
+
%Q{#<MLBGameday::Team @name="#{@name}">}
|
15
|
+
end
|
16
|
+
|
17
|
+
def name
|
18
|
+
@name
|
19
|
+
end
|
20
|
+
|
21
|
+
def city
|
22
|
+
@city
|
23
|
+
end
|
24
|
+
|
25
|
+
def league
|
26
|
+
@league
|
27
|
+
end
|
28
|
+
|
29
|
+
def division
|
30
|
+
@division
|
31
|
+
end
|
32
|
+
|
33
|
+
def names
|
34
|
+
@names
|
35
|
+
end
|
36
|
+
|
37
|
+
def code
|
38
|
+
@code
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/mlb_gameday.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mlb_gameday/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "mlb_gameday"
|
8
|
+
spec.version = MLBGameday::VERSION
|
9
|
+
spec.authors = ["Steven Hoffman"]
|
10
|
+
spec.email = ["git@fustrate.com"]
|
11
|
+
spec.description = %q{Access data about games and players from the official MLB Gameday API}
|
12
|
+
spec.summary = %q{Fetches gameday data from the MLB Gameday API}
|
13
|
+
spec.homepage = "http://github.com/fustrate/mlb_gameday"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
|
25
|
+
spec.add_dependency "httparty"
|
26
|
+
spec.add_dependency "nokogiri"
|
27
|
+
end
|
data/resources/data.yml
ADDED
@@ -0,0 +1,391 @@
|
|
1
|
+
---
|
2
|
+
:AL: &al !ruby/object:MLBGameday::League
|
3
|
+
name: American
|
4
|
+
divisions:
|
5
|
+
:East: &aleast !ruby/object:MLBGameday::Division
|
6
|
+
name: East
|
7
|
+
teams:
|
8
|
+
:BAL: !ruby/object:MLBGameday::Team
|
9
|
+
name: Orioles
|
10
|
+
city: Baltimore
|
11
|
+
league: *al
|
12
|
+
division: *aleast
|
13
|
+
code: BAL
|
14
|
+
names:
|
15
|
+
- bal
|
16
|
+
- orioles
|
17
|
+
- oriole
|
18
|
+
- baltimore
|
19
|
+
:BOS: !ruby/object:MLBGameday::Team
|
20
|
+
name: Red Sox
|
21
|
+
city: Boston
|
22
|
+
league: *al
|
23
|
+
division: *aleast
|
24
|
+
code: BOS
|
25
|
+
names:
|
26
|
+
- bos
|
27
|
+
- red sox
|
28
|
+
- redsox
|
29
|
+
- boston
|
30
|
+
- bosox
|
31
|
+
:NYY: !ruby/object:MLBGameday::Team
|
32
|
+
name: Yankees
|
33
|
+
city: New York
|
34
|
+
league: *al
|
35
|
+
division: *aleast
|
36
|
+
code: NYY
|
37
|
+
names:
|
38
|
+
- nyy
|
39
|
+
- yankees
|
40
|
+
- yankee
|
41
|
+
- new york yankees
|
42
|
+
- new york yankee
|
43
|
+
:TB: !ruby/object:MLBGameday::Team
|
44
|
+
name: Rays
|
45
|
+
city: Tampa Bay
|
46
|
+
league: *al
|
47
|
+
division: *aleast
|
48
|
+
code: TB
|
49
|
+
names:
|
50
|
+
- tb
|
51
|
+
- rays
|
52
|
+
- ray
|
53
|
+
- devil rays
|
54
|
+
- devil ray
|
55
|
+
- tampa
|
56
|
+
- tampa bay
|
57
|
+
:TOR: !ruby/object:MLBGameday::Team
|
58
|
+
name: Blue Jays
|
59
|
+
city: Toronto
|
60
|
+
league: *al
|
61
|
+
division: *aleast
|
62
|
+
code: TOR
|
63
|
+
names:
|
64
|
+
- tor
|
65
|
+
- blue jays
|
66
|
+
- blue jay
|
67
|
+
- bluejays
|
68
|
+
- bluejay
|
69
|
+
- jays
|
70
|
+
- jay
|
71
|
+
- toronto
|
72
|
+
:Central: &alcentral !ruby/object:MLBGameday::Division
|
73
|
+
name: Central
|
74
|
+
teams:
|
75
|
+
:CLE: !ruby/object:MLBGameday::Team
|
76
|
+
name: Indians
|
77
|
+
city: Cleveland
|
78
|
+
league: *al
|
79
|
+
division: *alcentral
|
80
|
+
code: CLE
|
81
|
+
names:
|
82
|
+
- cle
|
83
|
+
- indians
|
84
|
+
- indian
|
85
|
+
- cleveland
|
86
|
+
:CWS: !ruby/object:MLBGameday::Team
|
87
|
+
name: White Sox
|
88
|
+
city: Chicago
|
89
|
+
league: *al
|
90
|
+
division: *alcentral
|
91
|
+
code: CWS
|
92
|
+
names:
|
93
|
+
- cws
|
94
|
+
- white sox
|
95
|
+
- chicago white sox
|
96
|
+
:DET: !ruby/object:MLBGameday::Team
|
97
|
+
name: Tigers
|
98
|
+
city: Detroit
|
99
|
+
league: *al
|
100
|
+
division: *alcentral
|
101
|
+
code: DET
|
102
|
+
names:
|
103
|
+
- det
|
104
|
+
- tigers
|
105
|
+
- tiger
|
106
|
+
- detroit
|
107
|
+
:KC: !ruby/object:MLBGameday::Team
|
108
|
+
name: Royals
|
109
|
+
city: Kansas City
|
110
|
+
league: *al
|
111
|
+
division: *alcentral
|
112
|
+
code: KC
|
113
|
+
names:
|
114
|
+
- kc
|
115
|
+
- royals
|
116
|
+
- royal
|
117
|
+
- kansas city
|
118
|
+
- kansas
|
119
|
+
:MIN: !ruby/object:MLBGameday::Team
|
120
|
+
name: Twins
|
121
|
+
city: Minnesota
|
122
|
+
league: *al
|
123
|
+
division: *alcentral
|
124
|
+
code: MIN
|
125
|
+
names:
|
126
|
+
- min
|
127
|
+
- twins
|
128
|
+
- twin
|
129
|
+
- minnesota
|
130
|
+
:West: &alwest !ruby/object:MLBGameday::Division
|
131
|
+
name: West
|
132
|
+
teams:
|
133
|
+
:ANA: !ruby/object:MLBGameday::Team
|
134
|
+
name: Angels
|
135
|
+
city: Anaheim
|
136
|
+
league: *al
|
137
|
+
division: *alwest
|
138
|
+
code: ANA
|
139
|
+
names:
|
140
|
+
- ana
|
141
|
+
- angels
|
142
|
+
- angel
|
143
|
+
- anaheim
|
144
|
+
- ana
|
145
|
+
- los angeles angel
|
146
|
+
- los angeles angels
|
147
|
+
- la angels
|
148
|
+
- la angel
|
149
|
+
- laa
|
150
|
+
- laaa
|
151
|
+
- los angeles angels of anaheim
|
152
|
+
:HOU: !ruby/object:MLBGameday::Team
|
153
|
+
name: Astros
|
154
|
+
city: Houston
|
155
|
+
league: *al
|
156
|
+
division: *alwest
|
157
|
+
code: HOU
|
158
|
+
names:
|
159
|
+
- hou
|
160
|
+
- astros
|
161
|
+
- astro
|
162
|
+
- houston
|
163
|
+
:OAK: !ruby/object:MLBGameday::Team
|
164
|
+
name: Athletics
|
165
|
+
city: Oakland
|
166
|
+
league: *al
|
167
|
+
division: *alwest
|
168
|
+
code: OAK
|
169
|
+
names:
|
170
|
+
- oak
|
171
|
+
- athletics
|
172
|
+
- athletic
|
173
|
+
- as
|
174
|
+
- oakland
|
175
|
+
:SEA: !ruby/object:MLBGameday::Team
|
176
|
+
name: Mariners
|
177
|
+
city: Seattle
|
178
|
+
league: *al
|
179
|
+
division: *alwest
|
180
|
+
code: SEA
|
181
|
+
names:
|
182
|
+
- sea
|
183
|
+
- mariners
|
184
|
+
- mariner
|
185
|
+
- seattle
|
186
|
+
:TEX: !ruby/object:MLBGameday::Team
|
187
|
+
name: Rangers
|
188
|
+
city: Texas
|
189
|
+
league: *al
|
190
|
+
division: *alwest
|
191
|
+
code: TEX
|
192
|
+
names:
|
193
|
+
- tex
|
194
|
+
- rangers
|
195
|
+
- ranger
|
196
|
+
- texas
|
197
|
+
:NL: &nl !ruby/object:MLBGameday::League
|
198
|
+
name: National
|
199
|
+
divisions:
|
200
|
+
:East: &nleast !ruby/object:MLBGameday::Division
|
201
|
+
name: East
|
202
|
+
teams:
|
203
|
+
:ATL: !ruby/object:MLBGameday::Team
|
204
|
+
name: Braves
|
205
|
+
city: Atlanta
|
206
|
+
league: *nl
|
207
|
+
division: *nleast
|
208
|
+
code: ATL
|
209
|
+
names:
|
210
|
+
- atl
|
211
|
+
- braves
|
212
|
+
- brave
|
213
|
+
- atlanta
|
214
|
+
:MIA: !ruby/object:MLBGameday::Team
|
215
|
+
name: Marlins
|
216
|
+
city: Miami
|
217
|
+
league: *nl
|
218
|
+
division: *nleast
|
219
|
+
code: MIA
|
220
|
+
names:
|
221
|
+
- mia
|
222
|
+
- marlins
|
223
|
+
- marlin
|
224
|
+
- miami
|
225
|
+
- florida
|
226
|
+
:NYM: !ruby/object:MLBGameday::Team
|
227
|
+
name: Mets
|
228
|
+
city: New York
|
229
|
+
league: *nl
|
230
|
+
division: *nleast
|
231
|
+
code: NYM
|
232
|
+
names:
|
233
|
+
- nym
|
234
|
+
- mets
|
235
|
+
- met
|
236
|
+
- new york mets
|
237
|
+
- new york met
|
238
|
+
:PHI: !ruby/object:MLBGameday::Team
|
239
|
+
name: Phillies
|
240
|
+
city: Philadelphia
|
241
|
+
league: *nl
|
242
|
+
division: *nleast
|
243
|
+
code: PHI
|
244
|
+
names:
|
245
|
+
- phi
|
246
|
+
- phillies
|
247
|
+
- phillie
|
248
|
+
- philly
|
249
|
+
- philadelphia
|
250
|
+
:WSH: !ruby/object:MLBGameday::Team
|
251
|
+
name: Nationals
|
252
|
+
city: Washington
|
253
|
+
league: *nl
|
254
|
+
division: *nleast
|
255
|
+
code: WSH
|
256
|
+
names:
|
257
|
+
- wsh
|
258
|
+
- nationals
|
259
|
+
- natinals
|
260
|
+
- national
|
261
|
+
- washington
|
262
|
+
:Central: &nlcentral !ruby/object:MLBGameday::Division
|
263
|
+
name: Central
|
264
|
+
teams:
|
265
|
+
:CHC: !ruby/object:MLBGameday::Team
|
266
|
+
name: Cubs
|
267
|
+
city: Chicago
|
268
|
+
league: *nl
|
269
|
+
division: *nlcentral
|
270
|
+
code: CHC
|
271
|
+
names:
|
272
|
+
- chc
|
273
|
+
- cubs
|
274
|
+
- cub
|
275
|
+
- chicago cubs
|
276
|
+
- chicago cub
|
277
|
+
:CIN: !ruby/object:MLBGameday::Team
|
278
|
+
name: Reds
|
279
|
+
city: Cincinnati
|
280
|
+
league: *nl
|
281
|
+
division: *nlcentral
|
282
|
+
code: CIN
|
283
|
+
names:
|
284
|
+
- cin
|
285
|
+
- reds
|
286
|
+
- red
|
287
|
+
- cincinnati
|
288
|
+
:MIL: !ruby/object:MLBGameday::Team
|
289
|
+
name: Brewers
|
290
|
+
city: Milwaukee
|
291
|
+
league: *nl
|
292
|
+
division: *nlcentral
|
293
|
+
code: MIL
|
294
|
+
names:
|
295
|
+
- mil
|
296
|
+
- brewers
|
297
|
+
- brewer
|
298
|
+
- milwaukee
|
299
|
+
:PIT: !ruby/object:MLBGameday::Team
|
300
|
+
name: Pirates
|
301
|
+
city: Pittsburgh
|
302
|
+
league: *nl
|
303
|
+
division: *nlcentral
|
304
|
+
code: PIT
|
305
|
+
names:
|
306
|
+
- pit
|
307
|
+
- pirates
|
308
|
+
- pirate
|
309
|
+
- buccos
|
310
|
+
- bucco
|
311
|
+
- pittsburgh
|
312
|
+
:STL: !ruby/object:MLBGameday::Team
|
313
|
+
name: Cardinals
|
314
|
+
city: St. Louis
|
315
|
+
league: *nl
|
316
|
+
division: *nlcentral
|
317
|
+
code: STL
|
318
|
+
names:
|
319
|
+
- stl
|
320
|
+
- cardinals
|
321
|
+
- cardinal
|
322
|
+
- st louis
|
323
|
+
- st. louis
|
324
|
+
:West: &nlwest !ruby/object:MLBGameday::Division
|
325
|
+
name: West
|
326
|
+
teams:
|
327
|
+
:ARI: !ruby/object:MLBGameday::Team
|
328
|
+
name: Diamondbacks
|
329
|
+
city: Arizona
|
330
|
+
league: *nl
|
331
|
+
division: *nlwest
|
332
|
+
code: ARI
|
333
|
+
names:
|
334
|
+
- ari
|
335
|
+
- diamondbacks
|
336
|
+
- diamondback
|
337
|
+
- dbacks
|
338
|
+
- dback
|
339
|
+
- arizona
|
340
|
+
- az
|
341
|
+
:COL: !ruby/object:MLBGameday::Team
|
342
|
+
name: Rockies
|
343
|
+
city: Colorado
|
344
|
+
league: *nl
|
345
|
+
division: *nlwest
|
346
|
+
code: COL
|
347
|
+
names:
|
348
|
+
- col
|
349
|
+
- rockies
|
350
|
+
- rockie
|
351
|
+
- colorado
|
352
|
+
:LAD: !ruby/object:MLBGameday::Team
|
353
|
+
name: Dodgers
|
354
|
+
city: Los Angeles
|
355
|
+
league: *nl
|
356
|
+
division: *nlwest
|
357
|
+
code: LAD
|
358
|
+
names:
|
359
|
+
- lad
|
360
|
+
- dodgers
|
361
|
+
- dodger
|
362
|
+
- los angeles
|
363
|
+
- la
|
364
|
+
- los angeles dodgers
|
365
|
+
- los angeles dodger
|
366
|
+
- la dodger
|
367
|
+
- la dodgers
|
368
|
+
:SD: !ruby/object:MLBGameday::Team
|
369
|
+
name: Padres
|
370
|
+
city: San Diego
|
371
|
+
league: *nl
|
372
|
+
division: *nlwest
|
373
|
+
code: SD
|
374
|
+
names:
|
375
|
+
- sd
|
376
|
+
- padres
|
377
|
+
- padre
|
378
|
+
- san diego
|
379
|
+
:SF: !ruby/object:MLBGameday::Team
|
380
|
+
name: Giants
|
381
|
+
city: San Francisco
|
382
|
+
league: *nl
|
383
|
+
division: *nlwest
|
384
|
+
code: SF
|
385
|
+
names:
|
386
|
+
- sf
|
387
|
+
- giants
|
388
|
+
- giant
|
389
|
+
- san fran
|
390
|
+
- san francisco
|
391
|
+
- gigantes
|
data/spec/basic_spec.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "The basic MLB Gameday API object" do
|
4
|
+
before :all do
|
5
|
+
@api = MLBGameday::API.new
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should be created" do
|
9
|
+
expect(@api).to_not eq(nil)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should have 2 leagues" do
|
13
|
+
expect(@api.leagues.count).to eq(2)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should have 6 divisions" do
|
17
|
+
expect(@api.divisions.count).to eq(6)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should have 30 teams" do
|
21
|
+
expect(@api.teams.count).to eq(30)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should find the Dodgers by initials" do
|
25
|
+
expect(@api.team("LAD").city).to eq("Los Angeles")
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should find the Dodgers by name" do
|
29
|
+
expect(@api.team("Dodgers").city).to eq("Los Angeles")
|
30
|
+
end
|
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
|
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
|
40
|
+
|
41
|
+
it "should find one game for the Dodgers on 2013-04-01" do
|
42
|
+
dodgers = @api.team("Dodgers")
|
43
|
+
|
44
|
+
games = @api.find_games(team: dodgers, date: Date.parse("2013-04-01"))
|
45
|
+
|
46
|
+
expect(games.count).to eq(1)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should find a game by gid" do
|
50
|
+
game = @api.game("2013_04_01_sfnmlb_lanmlb_1")
|
51
|
+
|
52
|
+
expect(game.home_team.name).to eq("Dodgers")
|
53
|
+
end
|
54
|
+
end
|
data/spec/game_spec.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
# TODO: Mock or stub out the JSON files
|
4
|
+
|
5
|
+
describe "An MLB Gameday Game object" do
|
6
|
+
before :all do
|
7
|
+
@api = MLBGameday::API.new
|
8
|
+
|
9
|
+
@dodgers = @api.team("Dodgers")
|
10
|
+
@giants = @api.team("Giants")
|
11
|
+
|
12
|
+
@games = @api.find_games(team: @dodgers, date: Date.parse("2013-04-01"))
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should have two starting pitchers" do
|
16
|
+
game = @games[0]
|
17
|
+
|
18
|
+
expect(game.teams.count).to eq(2)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should have the correct venue" do
|
22
|
+
game = @games[0]
|
23
|
+
|
24
|
+
expect(game.venue).to eq("Dodger Stadium")
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should start at the correct time for the home team" do
|
28
|
+
game = @games[0]
|
29
|
+
|
30
|
+
expect(game.start_time).to eq("1:10 PT")
|
31
|
+
end
|
32
|
+
|
33
|
+
# TODO: Pick another game, LA and SF are both Pacific
|
34
|
+
it "should start at the correct time for the away team" do
|
35
|
+
game = @games[0]
|
36
|
+
|
37
|
+
expect(game.start_time(@giants)).to eq("1:10 PT")
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should have Clayton Kershaw starting" do
|
41
|
+
game = @games[0]
|
42
|
+
|
43
|
+
expect(game.home_pitcher.name).to eq("Clayton Kershaw")
|
44
|
+
end
|
45
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
{
|
2
|
+
"subject": "linescore_mlb_2013_03_24_gid_2013_03_24_lanmlb_oakmlb_1",
|
3
|
+
"copyright" : "Copyright 2013 MLB Advanced Media, L.P. Use of any content on this page acknowledges agreement to the terms posted here http://gdx.mlb.com/components/copyright.txt",
|
4
|
+
"data" : {
|
5
|
+
"game":{
|
6
|
+
"game_type":"S",
|
7
|
+
"double_header_sw":"N",
|
8
|
+
"away_time":"1:05",
|
9
|
+
"away_league_id_spring":"114",
|
10
|
+
"time":"4:05",
|
11
|
+
"home_time":"1:05",
|
12
|
+
"home_team_name":"Athletics",
|
13
|
+
"ind":"S",
|
14
|
+
"original_date":"2013/03/24",
|
15
|
+
"home_team_city":"Oakland",
|
16
|
+
"venue_id":"2524",
|
17
|
+
"gameday_sw":"Y",
|
18
|
+
"away_win":"11",
|
19
|
+
"away_probable_pitcher":{
|
20
|
+
"last":"Beckett",
|
21
|
+
"name_display_roster":"Beckett",
|
22
|
+
"number":"61",
|
23
|
+
"era":"0.96",
|
24
|
+
"id":"277417",
|
25
|
+
"first_name":"Josh",
|
26
|
+
"s_losses":"0",
|
27
|
+
"s_era":"-.--",
|
28
|
+
"last_name":"Beckett",
|
29
|
+
"losses":"0",
|
30
|
+
"first":"Josh",
|
31
|
+
"s_wins":"0",
|
32
|
+
"wins":"0"
|
33
|
+
},
|
34
|
+
"home_league_id_spring":"114",
|
35
|
+
"away_team_id":"119",
|
36
|
+
"tz_hm_lg_gen":"ET",
|
37
|
+
"status":"Preview",
|
38
|
+
"home_loss":"12",
|
39
|
+
"home_code":"oak",
|
40
|
+
"away_sport_code":"mlb",
|
41
|
+
"home_win":"11",
|
42
|
+
"time_hm_lg":"4:05",
|
43
|
+
"away_name_abbrev":"LAD",
|
44
|
+
"league":"NA",
|
45
|
+
"time_zone_aw_lg":"-4",
|
46
|
+
"home_file_code":"oak",
|
47
|
+
"away_split_squad":"N",
|
48
|
+
"game_data_directory":"/gameday/components/game/mlb/gid_2013_03_24_lanmlb_oakmlb_1",
|
49
|
+
"time_zone":"ET",
|
50
|
+
"away_league_id":"104",
|
51
|
+
"home_team_id":"133",
|
52
|
+
"time_aw_lg":"4:05",
|
53
|
+
"away_team_city":"LA Dodgers",
|
54
|
+
"day":"SUN",
|
55
|
+
"tz_aw_lg_gen":"ET",
|
56
|
+
"away_code":"lan",
|
57
|
+
"game_media":{
|
58
|
+
"media":{
|
59
|
+
"free":"NO",
|
60
|
+
"title":"LAD @ OAK",
|
61
|
+
"thumbnail":"http://mediadownloads.mlb.com/mlbam/preview/lanoak_363403_th_7_preview.jpg",
|
62
|
+
"media_state":"media_off",
|
63
|
+
"start":"2013-03-24T16:05:00-0400",
|
64
|
+
"has_mlbtv":"true",
|
65
|
+
"calendar_event_id":"14-363403-2013-03-24",
|
66
|
+
"type":"game"
|
67
|
+
}
|
68
|
+
},
|
69
|
+
"time_date_aw_lg":"2013/03/24 4:05",
|
70
|
+
"scheduled_innings":"9",
|
71
|
+
"venue_w_chan_loc":"USAZ0166",
|
72
|
+
"first_pitch_et":"",
|
73
|
+
"away_team_name":"Dodgers",
|
74
|
+
"gameday_link":"2013_03_24_lanmlb_oakmlb_1",
|
75
|
+
"time_date_hm_lg":"2013/03/24 4:05",
|
76
|
+
"id":"2013/03/24/lanmlb-oakmlb-1",
|
77
|
+
"home_name_abbrev":"OAK",
|
78
|
+
"tiebreaker_sw":"N",
|
79
|
+
"ampm":"PM",
|
80
|
+
"home_division":"W",
|
81
|
+
"home_split_squad":"N",
|
82
|
+
"home_time_zone":"PT",
|
83
|
+
"tv_station":"CSNCA, MLBN (delay)",
|
84
|
+
"away_time_zone":"PT",
|
85
|
+
"hm_lg_ampm":"PM",
|
86
|
+
"home_sport_code":"mlb",
|
87
|
+
"time_date":"2013/03/24 4:05",
|
88
|
+
"inning_state":"",
|
89
|
+
"home_ampm":"PM",
|
90
|
+
"game_pk":"363403",
|
91
|
+
"venue":"Phoenix Municipal Stadium",
|
92
|
+
"home_probable_pitcher":{
|
93
|
+
"last":"Griffin",
|
94
|
+
"name_display_roster":"Griffin",
|
95
|
+
"number":"64",
|
96
|
+
"era":"5.23",
|
97
|
+
"id":"456167",
|
98
|
+
"first_name":"A.J.",
|
99
|
+
"s_losses":"0",
|
100
|
+
"s_era":"-.--",
|
101
|
+
"last_name":"Griffin",
|
102
|
+
"losses":"1",
|
103
|
+
"first":"A.J.",
|
104
|
+
"s_wins":"0",
|
105
|
+
"wins":"1"
|
106
|
+
},
|
107
|
+
"home_league_id":"103",
|
108
|
+
"away_loss":"15",
|
109
|
+
"away_file_code":"la",
|
110
|
+
"aw_lg_ampm":"PM",
|
111
|
+
"time_zone_hm_lg":"-4",
|
112
|
+
"away_ampm":"PM",
|
113
|
+
"away_division":"W"
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
metadata
ADDED
@@ -0,0 +1,138 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mlb_gameday
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.alpha1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Steven Hoffman
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-03-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: httparty
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: nokogiri
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Access data about games and players from the official MLB Gameday API
|
84
|
+
email:
|
85
|
+
- git@fustrate.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- Gemfile
|
92
|
+
- LICENSE.txt
|
93
|
+
- README.md
|
94
|
+
- Rakefile
|
95
|
+
- lib/mlb_gameday.rb
|
96
|
+
- lib/mlb_gameday/batter.rb
|
97
|
+
- lib/mlb_gameday/division.rb
|
98
|
+
- lib/mlb_gameday/game.rb
|
99
|
+
- lib/mlb_gameday/league.rb
|
100
|
+
- lib/mlb_gameday/pitcher.rb
|
101
|
+
- lib/mlb_gameday/player.rb
|
102
|
+
- lib/mlb_gameday/team.rb
|
103
|
+
- lib/mlb_gameday/version.rb
|
104
|
+
- mlb_gameday.gemspec
|
105
|
+
- resources/data.yml
|
106
|
+
- spec/basic_spec.rb
|
107
|
+
- spec/game_spec.rb
|
108
|
+
- spec/spec_helper.rb
|
109
|
+
- spec/stubs/linescore.json
|
110
|
+
homepage: http://github.com/fustrate/mlb_gameday
|
111
|
+
licenses:
|
112
|
+
- MIT
|
113
|
+
metadata: {}
|
114
|
+
post_install_message:
|
115
|
+
rdoc_options: []
|
116
|
+
require_paths:
|
117
|
+
- lib
|
118
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - '>='
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - '>'
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: 1.3.1
|
128
|
+
requirements: []
|
129
|
+
rubyforge_project:
|
130
|
+
rubygems_version: 2.0.3
|
131
|
+
signing_key:
|
132
|
+
specification_version: 4
|
133
|
+
summary: Fetches gameday data from the MLB Gameday API
|
134
|
+
test_files:
|
135
|
+
- spec/basic_spec.rb
|
136
|
+
- spec/game_spec.rb
|
137
|
+
- spec/spec_helper.rb
|
138
|
+
- spec/stubs/linescore.json
|