ahl_scraper 0.3.6 → 0.3.7

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
  SHA256:
3
- metadata.gz: 361ba81452b6f5f3ea306d74730190b602b058636e75c99a803c1873afb3f0d7
4
- data.tar.gz: 1fea9a929d692523c9dde5f4bd243a6e9bf7bfff0ff38d7173534c199d0b03fc
3
+ metadata.gz: 19ac0b14d0b335af57c72d9a95ddbe1ed7c674990f56a52962e01ecd6112d4f5
4
+ data.tar.gz: 27eb465a69a64ee0c5171edbed58bea880901c5b9953dc91f6aacd75d01141b5
5
5
  SHA512:
6
- metadata.gz: a41ddd6414132e4c5e825854a1a45042dceab56fba3db9d853387de3630514062c5b059f353ae100e8ef738fb1163b61ef20e1ea1555c537998910d5b6d74237
7
- data.tar.gz: dc54c30d399a754adfd755a6a83f519dd9ddf602f6281e74411be5c5821f370c137535aea987d9166dc65ddf71148499b00c15a26645dac107ee3db07365cf1a
6
+ metadata.gz: 81e272f8523db112eabe3c4f1127b83e83593f8685eb567d851941f7f1d81411d5ffabd270a6afc86573af6426d247c83292dbd09e1e71f241d4d93ca3edfcff
7
+ data.tar.gz: '084d82bd3ca33d37aab4af2fd15a37508af4a67422069a5bed32466ee14bd9b28a194ec8e40dd39c37e42029bb5e55a6f6ba5aa4bf9e00c14eeb5881cc46209d'
@@ -0,0 +1,31 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ # GitHub recommends pinning actions to a commit SHA.
7
+ # To get a newer version, you will need to update the SHA.
8
+ # You can also reference a tag or branch, but the action may change without warning.
9
+
10
+ name: Tests
11
+
12
+ on:
13
+ push:
14
+ branches: [ main ]
15
+ pull_request:
16
+ branches: [ '*' ]
17
+
18
+ jobs:
19
+ test:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v3
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
26
+ with:
27
+ ruby-version: '2.7.3'
28
+ - name: Install dependencies
29
+ run: bundle install
30
+ - name: Run tests
31
+ run: bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.3.7
4
+
5
+ ### PlayoffBrackets::Series
6
+
7
+ - Add playoff season `80` to series wins needed dictionary
8
+ - Add default wins needed to dictionary and use for future seasons
9
+
3
10
  ## 0.3.6
4
11
 
5
12
  ### Game
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ahl_scraper (0.3.6)
4
+ ahl_scraper (0.3.7)
5
5
  json (~> 2.5.1)
6
6
  nokogiri (~> 1.12.4)
7
7
  rake (~> 13.0.0)
@@ -14,6 +14,8 @@ module AhlScraper
14
14
  "69" => { "1" => 4 },
15
15
  "72" => { "1" => 1, "2" => 1, "3" => 2, "4" => 2 },
16
16
  "76" => { "1" => 2, "2" => 3, "3" => 4, "4" => 4, "5" => 4 },
17
+ "80" => { "1" => 2, "2" => 3, "3" => 3, "4" => 4, "5" => 4 },
18
+ "default" => { "1" => 2, "2" => 3, "3" => 3, "4" => 4, "5" => 4 },
17
19
  }.freeze
18
20
 
19
21
  def id
@@ -85,7 +87,7 @@ module AhlScraper
85
87
  end
86
88
 
87
89
  def wins_needed
88
- @wins_needed ||= OVERRIDE_WINS_NEEDED.dig(season_id.to_s, round.to_s) || (round == 1 ? 3 : 4)
90
+ @wins_needed ||= find_wins_needed
89
91
  end
90
92
 
91
93
  def finished?
@@ -95,6 +97,14 @@ module AhlScraper
95
97
 
96
98
  private
97
99
 
100
+ def find_wins_needed
101
+ return OVERRIDE_WINS_NEEDED.dig(season_id.to_s, round.to_s) unless OVERRIDE_WINS_NEEDED.dig(season_id.to_s, round.to_s).nil?
102
+
103
+ return (round == 1 ? 3 : 4) if season_id.to_i < OVERRIDE_WINS_NEEDED.keys.map(&:to_i).max
104
+
105
+ OVERRIDE_WINS_NEEDED.dig("default", round.to_s)
106
+ end
107
+
98
108
  def find_season_id
99
109
  dig_season_id = @opts.dig(:bracket_data, :rounds, round - 1, :season_id)
100
110
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AhlScraper
4
- VERSION = "0.3.6"
4
+ VERSION = "0.3.7"
5
5
  end
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.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - jefftcraig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-19 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -185,6 +185,7 @@ executables: []
185
185
  extensions: []
186
186
  extra_rdoc_files: []
187
187
  files:
188
+ - ".github/workflows/ci.yml"
188
189
  - ".gitignore"
189
190
  - ".rspec"
190
191
  - ".rubocop.yml"