sorare-rewards 1.4.4 → 1.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -8
- data/lib/sorare/rewards/interactors/allocations/compute_for_game_week.rb +2 -1
- data/lib/sorare/rewards/interactors/allocations/compute_for_league.rb +2 -1
- data/lib/sorare/rewards/interactors/allocations/compute_for_quality.rb +2 -1
- data/lib/sorare/rewards/interactors/allocations/compute_for_rarity.rb +2 -1
- data/lib/sorare/rewards/interactors/build.rb +2 -1
- data/lib/sorare/rewards/interactors/cards/pick_for_division.rb +2 -1
- data/lib/sorare/rewards/interactors/cards/pick_for_division_and_rarity.rb +2 -1
- data/lib/sorare/rewards/interactors/cards/pick_for_division_rarity_and_quality.rb +5 -3
- data/lib/sorare/rewards/interactors/cards/pick_for_game_week.rb +2 -1
- data/lib/sorare/rewards/interactors/cards/pick_for_league.rb +3 -1
- data/lib/sorare/rewards/interactors/pick.rb +2 -1
- data/lib/sorare/rewards/interactors/prize_pools/compute_for_division.rb +2 -1
- data/lib/sorare/rewards/interactors/prize_pools/compute_for_game_week.rb +2 -1
- data/lib/sorare/rewards/interactors/prize_pools/compute_for_league.rb +2 -1
- data/lib/sorare/rewards/interactors/supply/compute_for_game_week.rb +2 -1
- data/lib/sorare/rewards/interactors/supply/compute_for_quality.rb +2 -1
- data/lib/sorare/rewards/interactors/supply/compute_for_rarity.rb +3 -2
- data/lib/sorare/rewards/interactors/tiers/qualify_players.rb +2 -1
- data/lib/sorare/rewards/interactors/tiers/qualify_supply.rb +2 -1
- data/lib/sorare/rewards/version.rb +1 -1
- data/sorare-rewards.gemspec +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6cf28260c062178e86145831e78dc6df1698d0dd5da71b9e912c43ad3490819
|
4
|
+
data.tar.gz: b8568cee0173df5c1f6682f6ebc8381e10102bb4a1bee09ff11836098e6be6fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3e88fbd0e0075431410adfa570d3f491039eb7172a933cce94cfded653dfe6f03599c73f35c7caaf5a49964e6235e3ae2d761f316f4ad7278b4c84641a7aab6
|
7
|
+
data.tar.gz: 6df7258e3b292a6ea86cf36d0602c08c4e8762c89629d50928fbc69feac19ac1c05fc2fc8dfcec6650c73f4067b573e15512967e0c52161d7312d33b53a0a722
|
data/Gemfile.lock
CHANGED
@@ -1,21 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sorare-rewards (1.4.
|
5
|
-
activesupport (
|
6
|
-
|
4
|
+
sorare-rewards (1.4.7)
|
5
|
+
activesupport (>= 6.1.4)
|
6
|
+
interactor_with_steroids (>= 1.0.0)
|
7
7
|
json (~> 2)
|
8
8
|
yaml (~> 0.2.0)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activesupport (
|
13
|
+
activesupport (7.0.1)
|
14
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
15
|
i18n (>= 1.6, < 2)
|
16
16
|
minitest (>= 5.1)
|
17
17
|
tzinfo (~> 2.0)
|
18
|
-
zeitwerk (~> 2.3)
|
19
18
|
addressable (2.8.0)
|
20
19
|
public_suffix (>= 2.0.2, < 5.0)
|
21
20
|
ast (2.4.2)
|
@@ -24,9 +23,10 @@ GEM
|
|
24
23
|
rexml
|
25
24
|
diff-lcs (1.4.4)
|
26
25
|
hashdiff (1.0.1)
|
27
|
-
i18n (1.
|
26
|
+
i18n (1.9.1)
|
28
27
|
concurrent-ruby (~> 1.0)
|
29
|
-
|
28
|
+
interactor_with_steroids (1.1.2)
|
29
|
+
activesupport
|
30
30
|
json (2.6.1)
|
31
31
|
minitest (5.15.0)
|
32
32
|
ostruct (0.4.0)
|
@@ -75,7 +75,6 @@ GEM
|
|
75
75
|
crack (>= 0.3.2)
|
76
76
|
hashdiff (>= 0.4.0, < 2.0.0)
|
77
77
|
yaml (0.2.0)
|
78
|
-
zeitwerk (2.5.3)
|
79
78
|
|
80
79
|
PLATFORMS
|
81
80
|
ruby
|
@@ -10,7 +10,8 @@ module Sorare
|
|
10
10
|
class ComputeForGameWeek
|
11
11
|
include Interactor
|
12
12
|
|
13
|
-
|
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)
|
@@ -22,7 +22,8 @@ module Sorare
|
|
22
22
|
class PickForDivision
|
23
23
|
include Interactor
|
24
24
|
|
25
|
-
|
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
|
-
|
20
|
+
receive :league, :rarity, :allocations, :pickers
|
21
|
+
hold :cards_picked
|
21
22
|
|
22
23
|
def call
|
23
24
|
context.cards_picked = supply!
|
@@ -13,9 +13,11 @@ module Sorare
|
|
13
13
|
class PickForDivisionRarityAndQuality
|
14
14
|
include Interactor
|
15
15
|
|
16
|
-
MISSING_CARDS = 'There are not enough cards to fulfill the requirements'
|
16
|
+
MISSING_CARDS = 'There are not enough cards to fulfill the requirements for %<league>s %<rarity>s'
|
17
|
+
|
18
|
+
receive :picker, :allocations, :league, :rarity, force: false
|
19
|
+
hold :cards_picked
|
17
20
|
|
18
|
-
delegate :picker, :allocations, :league, :rarity, :force, :cards_picked, to: :context
|
19
21
|
delegate :game_week, to: :league
|
20
22
|
|
21
23
|
def call
|
@@ -46,7 +48,7 @@ module Sorare
|
|
46
48
|
def check_length!
|
47
49
|
return if cards_picked.length == allocations
|
48
50
|
|
49
|
-
context.fail!(error: MISSING_CARDS)
|
51
|
+
context.fail!(error: format(MISSING_CARDS, { league: league, rarity: rarity }))
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -17,7 +17,9 @@ module Sorare
|
|
17
17
|
class PickForLeague
|
18
18
|
include Interactor
|
19
19
|
|
20
|
-
|
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
|
-
|
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
|
-
|
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|
|
@@ -9,7 +9,8 @@ module Sorare
|
|
9
9
|
class ComputeForQuality
|
10
10
|
include Interactor
|
11
11
|
|
12
|
-
|
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
|
-
|
13
|
-
|
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
|
data/sorare-rewards.gemspec
CHANGED
@@ -29,8 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ['lib']
|
31
31
|
|
32
|
-
spec.add_dependency 'activesupport', '
|
33
|
-
spec.add_dependency '
|
32
|
+
spec.add_dependency 'activesupport', '>= 6.1.4'
|
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,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorare-rewards
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.8
|
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-
|
11
|
+
date: 2022-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 6.1.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 6.1.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
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:
|
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:
|
40
|
+
version: 1.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: json
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|