sorare-rewards 1.4.4 → 1.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +4 -3
  3. data/lib/sorare/rewards/interactors/allocations/compute_for_game_week.rb +2 -1
  4. data/lib/sorare/rewards/interactors/allocations/compute_for_league.rb +2 -1
  5. data/lib/sorare/rewards/interactors/allocations/compute_for_quality.rb +2 -1
  6. data/lib/sorare/rewards/interactors/allocations/compute_for_rarity.rb +2 -1
  7. data/lib/sorare/rewards/interactors/build.rb +2 -1
  8. data/lib/sorare/rewards/interactors/cards/pick_for_division.rb +2 -1
  9. data/lib/sorare/rewards/interactors/cards/pick_for_division_and_rarity.rb +2 -1
  10. data/lib/sorare/rewards/interactors/cards/pick_for_division_rarity_and_quality.rb +3 -1
  11. data/lib/sorare/rewards/interactors/cards/pick_for_game_week.rb +2 -1
  12. data/lib/sorare/rewards/interactors/cards/pick_for_league.rb +3 -1
  13. data/lib/sorare/rewards/interactors/pick.rb +2 -1
  14. data/lib/sorare/rewards/interactors/prize_pools/compute_for_division.rb +2 -1
  15. data/lib/sorare/rewards/interactors/prize_pools/compute_for_game_week.rb +2 -1
  16. data/lib/sorare/rewards/interactors/prize_pools/compute_for_league.rb +2 -1
  17. data/lib/sorare/rewards/interactors/supply/compute_for_game_week.rb +2 -1
  18. data/lib/sorare/rewards/interactors/supply/compute_for_quality.rb +2 -1
  19. data/lib/sorare/rewards/interactors/supply/compute_for_rarity.rb +3 -2
  20. data/lib/sorare/rewards/interactors/tiers/qualify_players.rb +2 -1
  21. data/lib/sorare/rewards/interactors/tiers/qualify_supply.rb +2 -1
  22. data/lib/sorare/rewards/version.rb +1 -1
  23. data/sorare-rewards.gemspec +1 -1
  24. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64ce3ebddf119cf93cc3cb87a87576be330a1cea5673a91c4403c0be574ce484
4
- data.tar.gz: 3d5aedfa9b6b3a5bfef3793d62900c17a4ede3bb86eeed164a305173d43146b6
3
+ metadata.gz: a96e240df1e7ffc11d06b265919c29f86d1f74d07ec4878443276412bf1f9e95
4
+ data.tar.gz: f9e83487cad5213f909663cc0d903a6a7f9f92f09c48ea5cbdd8481f17b10a09
5
5
  SHA512:
6
- metadata.gz: 9255987966f248d9c46040efd606c2ed718953cd089d96692c982f6294fb16803b6d687c1e047f45c5142b50cf0a86cb51ca6d3dae1f4a6c072f8423bc22eb45
7
- data.tar.gz: 9ba2bb81da433811b482e721994035b03d96534d299ee513f96d7768cd3649a5604428a2625480a795049d84027635edce480f5deb36e21e1e646be9dcc2cd98
6
+ metadata.gz: 82a5ec0fc133697cb3e111a424a023c997eea978a0b04739b8dbc381849f6f3dd09d39d18a01c56876b4eab439bbe289043d36c9f5f82a1cf607402031303375
7
+ data.tar.gz: 6d73ca65887ad1a5c7aaf73b091f0b724db86cee40e702e017326b6650275305f69e41a087c42c06d6e1d11969d7b99127c66f53945f7b00076b5c4e446d8d93
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sorare-rewards (1.4.4)
4
+ sorare-rewards (1.4.5)
5
5
  activesupport (~> 6.1.4)
6
- interactor (~> 3.1.2)
6
+ interactor_with_steroids (~> 1.0.0)
7
7
  json (~> 2)
8
8
  yaml (~> 0.2.0)
9
9
 
@@ -26,7 +26,8 @@ GEM
26
26
  hashdiff (1.0.1)
27
27
  i18n (1.8.11)
28
28
  concurrent-ruby (~> 1.0)
29
- interactor (3.1.2)
29
+ interactor_with_steroids (1.0.0)
30
+ activesupport
30
31
  json (2.6.1)
31
32
  minitest (5.15.0)
32
33
  ostruct (0.4.0)
@@ -10,7 +10,8 @@ module Sorare
10
10
  class ComputeForGameWeek
11
11
  include Interactor
12
12
 
13
- delegate :supply, :randomizer, :public_seed, :salt, to: :context
13
+ receive :supply, :public_seed, :salt
14
+ hold :randomizer, :game_week_allocations
14
15
 
15
16
  def call
16
17
  context.randomizer = Sorare::Rewards::Random.new(public_seed, salt)
@@ -10,7 +10,8 @@ module Sorare
10
10
  class ComputeForLeague
11
11
  include Interactor
12
12
 
13
- delegate :supply, :config, to: :context
13
+ receive :supply, :config, :randomizer
14
+ hold :league_allocations
14
15
 
15
16
  def call
16
17
  context.league_allocations = allocate_and_format!
@@ -9,7 +9,8 @@ module Sorare
9
9
  class ComputeForQuality
10
10
  include Interactor
11
11
 
12
- delegate :supply, :config, :randomizer, :allocated, to: :context
12
+ receive :supply, :config, :randomizer
13
+ hold :allocated, :quality_allocations
13
14
 
14
15
  def call
15
16
  check_config!
@@ -10,7 +10,8 @@ module Sorare
10
10
  class ComputeForRarity
11
11
  include Interactor
12
12
 
13
- delegate :supply, :config, to: :context
13
+ receive :supply, :config, :randomizer
14
+ hold :rarity_allocations
14
15
 
15
16
  def call
16
17
  context.fail!(error: 'Invalid config') unless config
@@ -8,7 +8,8 @@ module Sorare
8
8
  class Build
9
9
  include Interactor
10
10
 
11
- delegate :game_week, to: :context
11
+ receive :game_week
12
+ hold :card_allocations, :prize_pools
12
13
 
13
14
  def call
14
15
  context.card_allocations = allocate!
@@ -22,7 +22,8 @@ module Sorare
22
22
  class PickForDivision
23
23
  include Interactor
24
24
 
25
- delegate :league, :allocations, :pickers, :qualified_players, to: :context
25
+ receive :league, :allocations, :pickers
26
+ hold :cards_picked
26
27
 
27
28
  def call
28
29
  context.cards_picked = allocations.keys.index_with do |rarity|
@@ -17,7 +17,8 @@ module Sorare
17
17
  class PickForDivisionAndRarity
18
18
  include Interactor
19
19
 
20
- delegate :league, :rarity, :allocations, :pickers, to: :context
20
+ receive :league, :rarity, :allocations, :pickers
21
+ hold :cards_picked
21
22
 
22
23
  def call
23
24
  context.cards_picked = supply!
@@ -15,7 +15,9 @@ module Sorare
15
15
 
16
16
  MISSING_CARDS = 'There are not enough cards to fulfill the requirements'
17
17
 
18
- delegate :picker, :allocations, :league, :rarity, :force, :cards_picked, to: :context
18
+ receive :picker, :allocations, :league, :rarity, force: false
19
+ hold :cards_picked
20
+
19
21
  delegate :game_week, to: :league
20
22
 
21
23
  def call
@@ -19,7 +19,8 @@ module Sorare
19
19
  class PickForGameWeek
20
20
  include Interactor
21
21
 
22
- delegate :game_week, :allocations, :picks, to: :context
22
+ receive :game_week, :allocations
23
+ hold :cards_picked
23
24
 
24
25
  def call
25
26
  context.cards_picked = pick!
@@ -17,7 +17,9 @@ module Sorare
17
17
  class PickForLeague
18
18
  include Interactor
19
19
 
20
- delegate :league, :allocations, :pickers, to: :context
20
+ receive :league, :allocations
21
+ hold :pickers, :cards_picked
22
+
21
23
  delegate :game_week, to: :league
22
24
  delegate :public_seed, :salt, to: :game_week
23
25
 
@@ -19,7 +19,8 @@ module Sorare
19
19
  class Pick
20
20
  include Interactor
21
21
 
22
- delegate :card_allocations, :game_week, :salt, to: :context
22
+ receive :card_allocations, :game_week, :salt
23
+ hold :cards_picked
23
24
 
24
25
  # Depending on the way the allocations interpreter is implemented it could be done by him or we
25
26
  # update the allocations process to match the structure
@@ -9,7 +9,8 @@ module Sorare
9
9
  class ComputeForDivision
10
10
  include Interactor
11
11
 
12
- delegate :playing_rate, :available_prize_pools, to: :context
12
+ receive :playing_rate, :available_prize_pools
13
+ hold :division_prize_pools
13
14
 
14
15
  def call
15
16
  context.division_prize_pools = available_prize_pools.map do |available_prize_pool|
@@ -10,7 +10,8 @@ module Sorare
10
10
  class ComputeForGameWeek
11
11
  include Interactor
12
12
 
13
- delegate :game_week, to: :context
13
+ receive :game_week
14
+ hold :prize_pools
14
15
 
15
16
  def call
16
17
  context.prize_pools = prize_pools!
@@ -9,7 +9,8 @@ module Sorare
9
9
  class ComputeForLeague
10
10
  include Interactor
11
11
 
12
- delegate :league, to: :context
12
+ receive :league
13
+ hold :league_prize_pools
13
14
 
14
15
  def call
15
16
  context.league_prize_pools = prize_pools!
@@ -10,7 +10,8 @@ module Sorare
10
10
  class ComputeForGameWeek
11
11
  include Interactor
12
12
 
13
- delegate :game_week, :game_week_supply, to: :context
13
+ receive :game_week
14
+ hold :game_week_supply
14
15
 
15
16
  def call
16
17
  context.game_week_supply = game_week_supply!
@@ -9,7 +9,8 @@ module Sorare
9
9
  class ComputeForQuality
10
10
  include Interactor
11
11
 
12
- delegate :randomizer, :total_supply, :tier_supply, :rewarded, :rewardable, to: :context
12
+ receive :randomizer, :total_supply, :tier_supply, :rewarded, :rewardable
13
+ hold :quality_supply
13
14
 
14
15
  def call
15
16
  context.quality_supply = total_supply.zero? ? 0 : quality_supply
@@ -9,8 +9,9 @@ module Sorare
9
9
  class ComputeForRarity
10
10
  include Interactor
11
11
 
12
- delegate :randomizer, :league, :rarity, :supply, :rewardable, :rarity_supply,
13
- :minimum_remaining_games, to: :context
12
+ receive :randomizer, :league, :rarity, :supply
13
+ hold :rarity_supply, :rewardable
14
+
14
15
  delegate :game_week, to: :league
15
16
 
16
17
  def call
@@ -10,7 +10,8 @@ module Sorare
10
10
  class QualifyPlayers
11
11
  include Interactor
12
12
 
13
- delegate :sorted_supply, to: :context
13
+ receive :sorted_supply
14
+ hold :players
14
15
 
15
16
  def call
16
17
  context.players = by_rank ? qualified_players_by_rank : qualified_players_by_tier
@@ -10,7 +10,8 @@ module Sorare
10
10
  class QualifySupply
11
11
  include Interactor
12
12
 
13
- delegate :sorted_supply, to: :context
13
+ receive :sorted_supply
14
+ hold :count, :supply
14
15
 
15
16
  def call
16
17
  context.count = sorted_supply.values.sum { |p| p['supply'] }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sorare
4
4
  module Rewards
5
- VERSION = '1.4.4'
5
+ VERSION = '1.4.5'
6
6
  end
7
7
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ['lib']
31
31
 
32
32
  spec.add_dependency 'activesupport', '~> 6.1.4'
33
- spec.add_dependency 'interactor', '~> 3.1.2'
33
+ spec.add_dependency 'interactor_with_steroids', '~> 1.0.0'
34
34
  spec.add_dependency 'json', '~> 2'
35
35
  spec.add_dependency 'yaml', '~> 0.2.0'
36
36
  spec.add_development_dependency 'ostruct', '~> 0.4.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorare-rewards
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sorare team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-03 00:00:00.000000000 Z
11
+ date: 2022-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 6.1.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: interactor
28
+ name: interactor_with_steroids
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.2
33
+ version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.2
40
+ version: 1.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: json
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  - !ruby/object:Gem::Version
228
228
  version: '0'
229
229
  requirements: []
230
- rubygems_version: 3.3.3
230
+ rubygems_version: 3.1.6
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: '["Sorare", "reward", "allocation", "algorithm"]'