y_fantasy 0.1.0 → 0.1.1

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: 4fa3a23dc0749a4169ee95d862127a9f88d85651439121a5cd694a541d7ec2e6
4
- data.tar.gz: b7a3fc4a5c320c29eefbbbedbfdd55983dc2c737eb75ab6c5120927b9c04f455
3
+ metadata.gz: 6c2a942239c407036e420e5c547b046b0c42e78d543b8e8179b806679b0ae614
4
+ data.tar.gz: c9a83075fedb911b3c82e6b162c63127053af49d77a55fb7abc42229912cffa9
5
5
  SHA512:
6
- metadata.gz: a8b0e3a377c985aa5c90caa3e543d6cff2628f31dfb53826a1e37c15a0a3727687ec2ecc25f739f3d0ba8450d238a468b6b16751c9c20e0cd72c6f11ab805a52
7
- data.tar.gz: 57d2e8415bd4f77426f4841b8e7ed23eb1d3848163f90eba7f2a6c4acd3efdd6c4466d0ff9adca6d72745b20043e4d433c5b34b1a52aeea361e735886016825e
6
+ metadata.gz: 62d5c578ec803af53a53b05a44b0fb8e8e6a4da2695d5a33995a4dd67e21fbd55ad6630a0ed08a29d2f0741738fdb51fb631f00e4402fb95ed04f61392094de1
7
+ data.tar.gz: 0dd9d30b22b70fb28eae8d190c1b2a27d0357b408236494122ffb6cb8ff845b4fc216769692439b9e85c55a06cf9417b446280885d871827c6c58b3486df832f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2025-08-18
4
+
5
+ - Add instance methods `true_week_picks` and `true_total_strikes` to `YFantasy::PickemTeam`.
6
+
3
7
  ## [0.1.0] - 2025-07-11
4
8
 
5
9
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- y_fantasy (0.1.0)
4
+ y_fantasy (0.1.1)
5
5
  dry-configurable (~> 1.0)
6
6
  dry-initializer (~> 3.0)
7
7
  dry-transformer (~> 1.0)
@@ -44,40 +44,42 @@ GEM
44
44
  docile (1.4.1)
45
45
  domain_name (0.6.20240107)
46
46
  drb (2.2.1)
47
- dry-configurable (1.1.0)
48
- dry-core (~> 1.0, < 2)
47
+ dry-configurable (1.3.0)
48
+ dry-core (~> 1.1)
49
49
  zeitwerk (~> 2.6)
50
- dry-core (1.0.1)
50
+ dry-core (1.1.0)
51
51
  concurrent-ruby (~> 1.0)
52
+ logger
52
53
  zeitwerk (~> 2.6)
53
- dry-inflector (1.0.0)
54
- dry-initializer (3.1.1)
55
- dry-logic (1.5.0)
54
+ dry-inflector (1.2.0)
55
+ dry-initializer (3.2.0)
56
+ dry-logic (1.6.0)
57
+ bigdecimal
56
58
  concurrent-ruby (~> 1.0)
57
- dry-core (~> 1.0, < 2)
59
+ dry-core (~> 1.1)
58
60
  zeitwerk (~> 2.6)
59
- dry-schema (1.13.3)
61
+ dry-schema (1.14.1)
60
62
  concurrent-ruby (~> 1.0)
61
63
  dry-configurable (~> 1.0, >= 1.0.1)
62
- dry-core (~> 1.0, < 2)
63
- dry-initializer (~> 3.0)
64
- dry-logic (>= 1.4, < 2)
65
- dry-types (>= 1.7, < 2)
64
+ dry-core (~> 1.1)
65
+ dry-initializer (~> 3.2)
66
+ dry-logic (~> 1.5)
67
+ dry-types (~> 1.8)
66
68
  zeitwerk (~> 2.6)
67
69
  dry-transformer (1.0.1)
68
70
  zeitwerk (~> 2.6)
69
- dry-types (1.7.2)
71
+ dry-types (1.8.3)
70
72
  bigdecimal (~> 3.0)
71
73
  concurrent-ruby (~> 1.0)
72
74
  dry-core (~> 1.0)
73
75
  dry-inflector (~> 1.0)
74
76
  dry-logic (~> 1.4)
75
77
  zeitwerk (~> 2.6)
76
- dry-validation (1.10.0)
78
+ dry-validation (1.11.1)
77
79
  concurrent-ruby (~> 1.0)
78
- dry-core (~> 1.0, < 2)
79
- dry-initializer (~> 3.0)
80
- dry-schema (>= 1.12, < 2)
80
+ dry-core (~> 1.1)
81
+ dry-initializer (~> 3.2)
82
+ dry-schema (~> 1.14)
81
83
  zeitwerk (~> 2.6)
82
84
  factory_bot (6.5.0)
83
85
  activesupport (>= 5.0.0)
@@ -104,21 +106,19 @@ GEM
104
106
  webrick (~> 1.7)
105
107
  webrobots (~> 0.1.2)
106
108
  method_source (1.1.0)
107
- mime-types (3.6.0)
109
+ mime-types (3.7.0)
108
110
  logger
109
- mime-types-data (~> 3.2015)
110
- mime-types-data (3.2025.0107)
111
+ mime-types-data (~> 3.2025, >= 3.2025.0507)
112
+ mime-types-data (3.2025.0722)
111
113
  minitest (5.25.4)
112
114
  mutex_m (0.3.0)
113
115
  net-http-digest_auth (1.4.1)
114
- net-http-persistent (4.0.5)
115
- connection_pool (~> 2.2)
116
+ net-http-persistent (4.0.6)
117
+ connection_pool (~> 2.2, >= 2.2.4)
116
118
  nkf (0.2.0)
117
- nokogiri (1.18.2-arm64-darwin)
118
- racc (~> 1.4)
119
- nokogiri (1.18.2-x86_64-darwin)
119
+ nokogiri (1.18.9-arm64-darwin)
120
120
  racc (~> 1.4)
121
- ox (2.14.20)
121
+ ox (2.14.23)
122
122
  bigdecimal (>= 3.0)
123
123
  parallel (1.26.3)
124
124
  parser (3.3.7.0)
@@ -186,7 +186,7 @@ GEM
186
186
  standard-performance (1.6.0)
187
187
  lint_roller (~> 1.1)
188
188
  rubocop-performance (~> 1.23.0)
189
- thor (1.3.2)
189
+ thor (1.4.0)
190
190
  tzinfo (2.0.6)
191
191
  concurrent-ruby (~> 1.0)
192
192
  unicode-display_width (3.1.4)
@@ -198,7 +198,7 @@ GEM
198
198
  hashdiff (>= 0.4.0, < 2.0.0)
199
199
  webrick (1.9.1)
200
200
  webrobots (0.1.2)
201
- zeitwerk (2.6.12)
201
+ zeitwerk (2.7.3)
202
202
 
203
203
  PLATFORMS
204
204
  arm64-darwin-21
@@ -92,7 +92,26 @@ module YFantasy
92
92
  # Returns the group this PickemTeam belongs to
93
93
  # @return [Group] the group object
94
94
  def group
95
- @group ||= Group.find(group_key)
95
+ @group ||= Group.find(group_key, with: :settings)
96
+ end
97
+
98
+ # Returns the week picks up to and including the group end week
99
+ # For some reason, Yahoo's API can return more weeks than the group settings allow, and they are always strikes.
100
+ # @return [Array<WeekPick>] the weekly picks for this team
101
+ def true_week_picks
102
+ @true_week_picks = week_picks.slice(0, group.settings.end_week)
103
+ end
104
+
105
+ # Returns the "true" total strikes, based on the group end week.
106
+ # If the group allows two picks per week, fall back to `total_strikes` from the PickemTeam.
107
+ # @return [Integer] the "true" total strikes for this team
108
+ def true_total_strikes
109
+ return total_strikes if group.settings.two_pick_start_week != 0
110
+
111
+ strikes = true_week_picks.count { |wp| wp.picks.first.result == "strike" }
112
+ return group.settings.max_strikes if strikes > group.settings.max_strikes
113
+
114
+ strikes
96
115
  end
97
116
  end
98
117
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YFantasy
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: y_fantasy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Aylward