ahl_scraper 0.3.1 → 0.3.2
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 +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/ahl_scraper/helpers/ice_time_helper.rb +3 -1
- data/lib/ahl_scraper/helpers/period_time_helper.rb +6 -2
- data/lib/ahl_scraper/resources/game.rb +3 -3
- data/lib/ahl_scraper/resources/games/goalie.rb +1 -1
- data/lib/ahl_scraper/resources/games/penalty_shot.rb +0 -5
- data/lib/ahl_scraper/resources/seasons/team.rb +2 -2
- data/lib/ahl_scraper/services/games/penalty_shots_service.rb +1 -6
- data/lib/ahl_scraper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fc138bb02a9563b2b9a4940a15dd9bd6e56f56d5b7352bddbb09fb2a63a7c0d
|
4
|
+
data.tar.gz: 4292c6ed3cd9c4da7f92aa6b861fa2d40a7cc1c933962c8c55610e34819317f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc5998864a75a5a351c2f42eb97066340e681024af5da5d766077dc80d581a5c767340aa9b5125d06da1e40cd615e1c7805d86a831b28f5174d3632dd6d6f14f
|
7
|
+
data.tar.gz: 8cb1e8fa0b79e50bacf1b4755120f3e41382b8f1b0fb542352af6ea744e62719b2c0b9cb821631c3efa3ffdef1491828742a519023b7eb9d300689f947a526ec
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.3.2
|
4
|
+
|
5
|
+
## General
|
6
|
+
|
7
|
+
- Changed `.split` to `&.split` and use `.dig` more to not fail when fields don't exist (often on games that have not finished)
|
8
|
+
|
9
|
+
### Game::Goalie
|
10
|
+
|
11
|
+
- Fix penalty minutes not being copied to the object because of a typo
|
12
|
+
|
3
13
|
## 0.3.1
|
4
14
|
|
5
15
|
### Scoreboards
|
@@ -10,12 +10,16 @@ module AhlScraper
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def to_period_seconds
|
13
|
-
|
13
|
+
return unless time
|
14
|
+
|
15
|
+
period_time = time&.split(":")
|
14
16
|
period_time[0].to_i * 60 + period_time[1].to_i
|
15
17
|
end
|
16
18
|
|
17
19
|
def to_time_elapsed
|
18
|
-
|
20
|
+
return unless time
|
21
|
+
|
22
|
+
period_time = time&.split(":")
|
19
23
|
period_time[0].to_i * 60 + period_time[1].to_i + ((period - 1) * 1200)
|
20
24
|
end
|
21
25
|
|
@@ -344,12 +344,12 @@ module AhlScraper
|
|
344
344
|
irregular_game_status = IRREGULAR_GAMES.dig(game_id.to_s, :status)
|
345
345
|
return irregular_game_status if irregular_game_status
|
346
346
|
|
347
|
-
return "postponed" if @raw_data
|
347
|
+
return "postponed" if @raw_data.dig(:details, :status) == "Postponed"
|
348
348
|
# return "forfeited" if game is a forfeit, need to figure this out if it happens
|
349
349
|
|
350
|
-
return "finished" if @raw_data
|
350
|
+
return "finished" if @raw_data.dig(:details, :final) == "1"
|
351
351
|
|
352
|
-
return "in_progress" if @raw_data
|
352
|
+
return "in_progress" if @raw_data.dig(:details, :started) == "1"
|
353
353
|
|
354
354
|
"not_started"
|
355
355
|
end
|
@@ -44,7 +44,7 @@ module AhlScraper
|
|
44
44
|
goals: @raw_data[:stats][:goals],
|
45
45
|
assists: @raw_data[:stats][:assists],
|
46
46
|
points: @raw_data[:stats][:points],
|
47
|
-
penalty_minutes: @raw_data[:stats][:
|
47
|
+
penalty_minutes: @raw_data[:stats][:penaltyMinutes],
|
48
48
|
toi: @raw_data[:stats][:timeOnIce],
|
49
49
|
toi_in_seconds: set_time_on_ice_in_seconds,
|
50
50
|
shots_against: @raw_data[:stats][:shotsAgainst],
|
@@ -51,11 +51,11 @@ module AhlScraper
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def city
|
54
|
-
@city ||= full_name
|
54
|
+
@city ||= full_name&.split.length > 2 ? exception_split_object&.dig(:city) : full_name&.split[0]
|
55
55
|
end
|
56
56
|
|
57
57
|
def name
|
58
|
-
@name ||= full_name
|
58
|
+
@name ||= full_name&.split.length > 2 ? exception_split_object&.dig(:name) : full_name&.split[1]
|
59
59
|
end
|
60
60
|
|
61
61
|
def game_file_city
|
@@ -17,14 +17,9 @@ module AhlScraper
|
|
17
17
|
|
18
18
|
def ordered_penalty_shots
|
19
19
|
@ordered_penalty_shots ||= penalty_shot_data.sort do |a, b|
|
20
|
-
[a[:period][:id].to_i,
|
20
|
+
[a[:period][:id].to_i, IceTimeHelper.new(a[:time]).to_sec] <=> [b[:period][:id].to_i, IceTimeHelper.new(b[:time]).to_sec]
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
24
|
-
def convert_time(game_time)
|
25
|
-
time = game_time.split(":")
|
26
|
-
time[0].to_i * 60 + time[1].to_i
|
27
|
-
end
|
28
23
|
end
|
29
24
|
end
|
30
25
|
end
|
data/lib/ahl_scraper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahl_scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jefftcraig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|