nfl_data 0.0.8 → 0.0.9
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20602999e287b633dfc6351d01e33a834a1df252
|
4
|
+
data.tar.gz: a62ef29bef9b64b1447d6914b433039c6f1fc1a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 445d8ac1df6b875dc53097db63ac7c9135e18ea57ad7ce3e16fbe57f70ee295dde7bfb9e61a8ae70eaa08f742f9fab203777d8eec0946025a8e6c66e6a01d228
|
7
|
+
data.tar.gz: 74164f1e2c0b8e0d8e37cf1c189d6cc19bfc7d79fb6bb2a59b147b043c9375359299f1112b4eed1f02b8c186810f58a01c909ca7356de95286f12a92fcc4d0d6
|
@@ -33,12 +33,18 @@ module NflData
|
|
33
33
|
team = Team.new
|
34
34
|
team.name = link.inner_text.strip
|
35
35
|
team.short_name = link.attribute('href').value.scan(/=(.*)/).flatten.first
|
36
|
+
make_jacksonville_abbreviation_consistent(team)
|
36
37
|
team.schedule = get_schedule(team, year) if with_schedule
|
37
38
|
|
38
39
|
team.to_hash
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
43
|
+
def make_jacksonville_abbreviation_consistent(team)
|
44
|
+
# Use JAX because schedule pages use JAX and it's easier to fix it here
|
45
|
+
team.short_name = 'JAX' if team.short_name == 'JAC'
|
46
|
+
end
|
47
|
+
|
42
48
|
def get_schedule(team, year)
|
43
49
|
url = "http://www.nfl.com/teams/schedule?seasonType=REG&team=#{team.short_name}&season=#{year}"
|
44
50
|
schedule = Team::Schedule.new
|
data/lib/nfl_data/version.rb
CHANGED
@@ -37,7 +37,7 @@ describe PlayerParser do
|
|
37
37
|
response = @parser.get_by_position(:wide_receivers)
|
38
38
|
|
39
39
|
response.keys.must_include :wide_receivers
|
40
|
-
response[:wide_receivers].count.must_equal
|
40
|
+
response[:wide_receivers].count.must_equal 372
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -57,7 +57,7 @@ describe PlayerParser do
|
|
57
57
|
{
|
58
58
|
quarterbacks: 121,
|
59
59
|
runningbacks: 231,
|
60
|
-
wide_receivers:
|
60
|
+
wide_receivers: 372,
|
61
61
|
tight_ends: 190
|
62
62
|
}.each do |position, player_count|
|
63
63
|
response.keys.must_include position
|
@@ -22,7 +22,17 @@ describe TeamParser do
|
|
22
22
|
|
23
23
|
it 'should get all the teams for year with schedule' do
|
24
24
|
VCR.use_cassette('teams_with_schedule') do
|
25
|
-
@parser.get_by_year(2014, true)
|
25
|
+
result = @parser.get_by_year(2014, true)
|
26
|
+
result.count.must_equal 32
|
27
|
+
result.each do |team|
|
28
|
+
team[:schedule].count.must_equal 17 # includes bye weeks
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should use JAX as the abbreviation for Jacksonville' do
|
34
|
+
VCR.use_cassette('teams_with_schedule') do
|
35
|
+
@parser.get_by_year(2014, true).any? {|team| team[:short_name] == 'JAX'}.must_equal true
|
26
36
|
end
|
27
37
|
end
|
28
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nfl_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thetizzo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|