fantasy_football_nerd 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fantasy_football_nerd/commercial_feeds.rb +14 -12
- data/spec/commercial_feeds_spec.rb +5 -0
- data/spec/vcr/cassettes/Fantasy_Football_Nerd_Commercial_Feeds/should_not_throw_an_error_for_id.yml +53 -0
- data/spec/vcr/cassettes/Fantasy_Football_Nerd_Commercial_Feeds/should_retrieve_stats_for_player_id_1.yml +103 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3842e156300592a0da372fb04b583674528b2f4f
|
4
|
+
data.tar.gz: 18ef5a5bbe5f30b232d08c32391d418afdd619b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5f9264d51af0e0e8d4db518fed753f1255ec6a1c727b07f225d430e86b6f87e511965e178fb603ea60035fb03e9b1b51b67ce77597c2f031ab081a2e4b1f21a
|
7
|
+
data.tar.gz: ff8fd03adc572383b9b33e11ac216f07f28ded696b5e3d6d965dd49c0d4e3b50aa584c1ed8cd30b4afd1054383bcc0956e6e2e8391710e8a221ee0ebecb70eba
|
@@ -10,9 +10,11 @@ module CommercialFeeds
|
|
10
10
|
raise 'You must pass along a player id' if id.nil?
|
11
11
|
data = request_service('player', FFNerd.api_key, id)
|
12
12
|
data = data['Stats']
|
13
|
-
data
|
14
|
-
|
15
|
-
|
13
|
+
if data
|
14
|
+
data.change_keys_to_ints
|
15
|
+
data.each do |year, weeks|
|
16
|
+
weeks.each { |week, stats| weeks[week] = create_stats_ostruct(stats) }
|
17
|
+
end
|
16
18
|
end
|
17
19
|
data
|
18
20
|
end
|
@@ -26,19 +28,19 @@ module CommercialFeeds
|
|
26
28
|
|
27
29
|
def new_keys
|
28
30
|
{
|
29
|
-
'passAttempts' => '
|
31
|
+
'passAttempts' => 'pass_att',
|
30
32
|
'interceptions' => 'pass_int',
|
31
|
-
'passYards' => '
|
32
|
-
'avgPassYards' => '
|
33
|
-
'passYards' => '
|
33
|
+
'passYards' => 'pass_yds',
|
34
|
+
'avgPassYards' => 'avg_pass_yds',
|
35
|
+
'passYards' => 'pass_yds',
|
34
36
|
'Sacks' => 'sacks',
|
35
|
-
'SackYards' => '
|
37
|
+
'SackYards' => 'sack_yds',
|
36
38
|
'QBRating' => 'qb_rating',
|
37
|
-
'rushAttempts' => '
|
38
|
-
'rushYards' => '
|
39
|
-
'recYards' => '
|
39
|
+
'rushAttempts' => 'rush_att',
|
40
|
+
'rushYards' => 'rush_yds',
|
41
|
+
'recYards' => 'rec_yds',
|
40
42
|
'fumble' => 'fumbles',
|
41
|
-
'fumbleLost' => '
|
43
|
+
'fumbleLost' => 'fumbles_lost'
|
42
44
|
}
|
43
45
|
end
|
44
46
|
|
@@ -83,4 +83,9 @@ describe 'Fantasy Football Nerd Commercial Feeds', vcr: true do
|
|
83
83
|
expect(stats.fumbles_lost).to eq 0
|
84
84
|
end
|
85
85
|
|
86
|
+
it 'should not throw an error for id' do
|
87
|
+
# there are no stats available for this player
|
88
|
+
expect{ FFNerd.player_stats('1') }.not_to raise_error
|
89
|
+
end
|
90
|
+
|
86
91
|
end
|
data/spec/vcr/cassettes/Fantasy_Football_Nerd_Commercial_Feeds/should_not_throw_an_error_for_id.yml
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.fantasyfootballnerd.com/service/player/json/test/1
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Sun, 21 Sep 2014 02:38:27 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Content-Length:
|
26
|
+
- '35'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Set-Cookie:
|
30
|
+
- __cfduid=da20a1acc14eec8ed9e7a796c682e31e61411267107787; expires=Mon, 23-Dec-2019
|
31
|
+
23:50:00 GMT; path=/; domain=.fantasyfootballnerd.com; HttpOnly
|
32
|
+
Expires:
|
33
|
+
- Mon, 21 Sep 2015 02:38:27 GMT
|
34
|
+
Cache-Control:
|
35
|
+
- public, max-age=31536000
|
36
|
+
Pragma:
|
37
|
+
- no-cache
|
38
|
+
X-Powered-By:
|
39
|
+
- PleskLin
|
40
|
+
Cf-Cache-Status:
|
41
|
+
- HIT
|
42
|
+
Vary:
|
43
|
+
- Accept-Encoding
|
44
|
+
Server:
|
45
|
+
- cloudflare-nginx
|
46
|
+
Cf-Ray:
|
47
|
+
- 16d2e2ffa7230165-ORD
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: '{"Error":"Test Data Not Available"}'
|
51
|
+
http_version:
|
52
|
+
recorded_at: Sun, 21 Sep 2014 02:38:27 GMT
|
53
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,103 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://www.fantasyfootballnerd.com/service/player/json/test/1
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Sun, 21 Sep 2014 02:25:12 GMT
|
23
|
+
Content-Type:
|
24
|
+
- application/json
|
25
|
+
Content-Length:
|
26
|
+
- '35'
|
27
|
+
Connection:
|
28
|
+
- keep-alive
|
29
|
+
Set-Cookie:
|
30
|
+
- __cfduid=d76928550494de170feb5111ee761ba701411266312323; expires=Mon, 23-Dec-2019
|
31
|
+
23:50:00 GMT; path=/; domain=.fantasyfootballnerd.com; HttpOnly
|
32
|
+
Expires:
|
33
|
+
- Mon, 21 Sep 2015 02:25:12 GMT
|
34
|
+
Cache-Control:
|
35
|
+
- public, max-age=31536000
|
36
|
+
Pragma:
|
37
|
+
- no-cache
|
38
|
+
X-Powered-By:
|
39
|
+
- PleskLin
|
40
|
+
Cf-Cache-Status:
|
41
|
+
- MISS
|
42
|
+
Vary:
|
43
|
+
- Accept-Encoding
|
44
|
+
Server:
|
45
|
+
- cloudflare-nginx
|
46
|
+
Cf-Ray:
|
47
|
+
- 16d2cf940cda0165-ORD
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: '{"Error":"Test Data Not Available"}'
|
51
|
+
http_version:
|
52
|
+
recorded_at: Sun, 21 Sep 2014 02:25:11 GMT
|
53
|
+
- request:
|
54
|
+
method: get
|
55
|
+
uri: http://www.fantasyfootballnerd.com/service/player/json/test/1
|
56
|
+
body:
|
57
|
+
encoding: US-ASCII
|
58
|
+
string: ''
|
59
|
+
headers:
|
60
|
+
Accept-Encoding:
|
61
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
62
|
+
Accept:
|
63
|
+
- '*/*'
|
64
|
+
User-Agent:
|
65
|
+
- Ruby
|
66
|
+
response:
|
67
|
+
status:
|
68
|
+
code: 200
|
69
|
+
message: OK
|
70
|
+
headers:
|
71
|
+
Date:
|
72
|
+
- Sun, 21 Sep 2014 02:28:37 GMT
|
73
|
+
Content-Type:
|
74
|
+
- application/json
|
75
|
+
Content-Length:
|
76
|
+
- '35'
|
77
|
+
Connection:
|
78
|
+
- keep-alive
|
79
|
+
Set-Cookie:
|
80
|
+
- __cfduid=d4e8a19dc1ce7cead108dd6ffd4cc1dbb1411266517118; expires=Mon, 23-Dec-2019
|
81
|
+
23:50:00 GMT; path=/; domain=.fantasyfootballnerd.com; HttpOnly
|
82
|
+
Expires:
|
83
|
+
- Mon, 21 Sep 2015 02:28:37 GMT
|
84
|
+
Cache-Control:
|
85
|
+
- public, max-age=31536000
|
86
|
+
Pragma:
|
87
|
+
- no-cache
|
88
|
+
X-Powered-By:
|
89
|
+
- PleskLin
|
90
|
+
Cf-Cache-Status:
|
91
|
+
- HIT
|
92
|
+
Vary:
|
93
|
+
- Accept-Encoding
|
94
|
+
Server:
|
95
|
+
- cloudflare-nginx
|
96
|
+
Cf-Ray:
|
97
|
+
- 16d2d493fa88042a-ORD
|
98
|
+
body:
|
99
|
+
encoding: UTF-8
|
100
|
+
string: '{"Error":"Test Data Not Available"}'
|
101
|
+
http_version:
|
102
|
+
recorded_at: Sun, 21 Sep 2014 02:28:36 GMT
|
103
|
+
recorded_with: VCR 2.9.2
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fantasy_football_nerd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Baugues
|
@@ -27,10 +27,12 @@ files:
|
|
27
27
|
- spec/request_spec.rb
|
28
28
|
- spec/spec_helper.rb
|
29
29
|
- spec/util_spec.rb
|
30
|
+
- spec/vcr/cassettes/Fantasy_Football_Nerd_Commercial_Feeds/should_not_throw_an_error_for_id.yml
|
30
31
|
- spec/vcr/cassettes/Fantasy_Football_Nerd_Commercial_Feeds/should_retrieve_Brady_s_player_stats.yml
|
31
32
|
- spec/vcr/cassettes/Fantasy_Football_Nerd_Commercial_Feeds/should_retrieve_Forte_s_player_stats.yml
|
32
33
|
- spec/vcr/cassettes/Fantasy_Football_Nerd_Commercial_Feeds/should_retrieve_a_player.yml
|
33
34
|
- spec/vcr/cassettes/Fantasy_Football_Nerd_Commercial_Feeds/should_retrieve_player_information.yml
|
35
|
+
- spec/vcr/cassettes/Fantasy_Football_Nerd_Commercial_Feeds/should_retrieve_stats_for_player_id_1.yml
|
34
36
|
- spec/vcr/cassettes/Fantasy_Football_Nerd_Gem/should_retrieve_auction_values.yml
|
35
37
|
- spec/vcr/cassettes/Fantasy_Football_Nerd_Gem/should_retrieve_bye_weeks.yml
|
36
38
|
- spec/vcr/cassettes/Fantasy_Football_Nerd_Gem/should_retrieve_draft_projections.yml
|