deck_of_cards_handler 0.1.6 → 0.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6a1a1dd5335b11ff724511d5d322b9d50f2d58dd3397b02eefdc9cef3f5a552
|
4
|
+
data.tar.gz: 79619874720f88fc3828ba1562e9171c2ab0d9d6a955bae07e3bed0dd2681453
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 775cde0e2b4948b4052c7e1abb21a377212821016f390942c5cae7a739195f2efcd74b7b7b64f2bd9ced44e0a637fc05f5797faa282850bd1bdf8187854d515e
|
7
|
+
data.tar.gz: b40aef85c522e65bcd590ed920c9113d16e4a64750d8a6b534fa72be150e01743d46631d3ec8eff434275089d73b2ba1820975dcef958e81a18485e45b6b3336
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
AllCops:
|
2
2
|
TargetRubyVersion: 3.1
|
3
3
|
|
4
|
+
Metrics/AbcSize:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Metrics/MethodLength:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Metrics/ClassLength:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Style/Documentation:
|
14
|
+
Enabled: false
|
15
|
+
|
4
16
|
Style/StringLiterals:
|
5
17
|
EnforcedStyle: double_quotes
|
6
18
|
|
@@ -29,7 +29,7 @@ class Packet
|
|
29
29
|
extend T::Sig
|
30
30
|
|
31
31
|
sig { params(file_path: String).returns(Packet) }
|
32
|
-
def build_from_text_file(file_path:)
|
32
|
+
def build_from_text_file(file_path:)
|
33
33
|
file_content = File.read(file_path)
|
34
34
|
cards = []
|
35
35
|
cards_set = Set.new
|
@@ -53,7 +53,7 @@ class Packet
|
|
53
53
|
end
|
54
54
|
|
55
55
|
sig { overridable.params(string: String).returns(Packet) }
|
56
|
-
def build_from_string(string:)
|
56
|
+
def build_from_string(string:)
|
57
57
|
content = string.split(",").map(&:strip)
|
58
58
|
cards = []
|
59
59
|
cards_set = Set.new
|
@@ -5,7 +5,7 @@ module Shuffles
|
|
5
5
|
class << self
|
6
6
|
extend T::Sig
|
7
7
|
sig { params(left_half: Packet, right_half: Packet).returns(T::Array[Card]) }
|
8
|
-
def riffle_shuffle(left_half:, right_half:)
|
8
|
+
def riffle_shuffle(left_half:, right_half:)
|
9
9
|
shuffled_cards = []
|
10
10
|
until left_half.cards.empty? && right_half.cards.empty?
|
11
11
|
if !left_half.cards.empty? && (right_half.cards.empty? || Kernel.rand < 0.5)
|
@@ -22,7 +22,7 @@ module PokerHands
|
|
22
22
|
end
|
23
23
|
|
24
24
|
sig { override.params(other: T.untyped).returns(T.nilable(Integer)) }
|
25
|
-
def <=>(other)
|
25
|
+
def <=>(other)
|
26
26
|
return rank <=> other.rank unless instance_of?(other.class)
|
27
27
|
|
28
28
|
first_pair_comparison = pair_values.first <=> other.pair_values.first
|