decktet 0.2.0 → 0.2.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 +4 -4
- data/decktet.gemspec +1 -1
- data/lib/decktet/pile.rb +4 -4
- data/lib/decktet/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5cfdf9b26b03190597b2cbc8d5b90a980236fe5257625c9234f98a4147749bd7
|
|
4
|
+
data.tar.gz: 0cea8e3fc679d508c33fab6e57fa10ef55e75e1ababa51b5ab13c848b83fc4d2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 758eae1a50a74480a0030db5bdfe090ff25943616a97ad92f2bd949631ad706373d21f1d5826323efe89f4f6d4f0f2146d149603033c1ec59919c742d4c17ae5
|
|
7
|
+
data.tar.gz: 51240024f27af0ae97c621d4feb2e2bc170846907c32d56f5cf7e2856686b8cd66d20e81d9bd5c8f4d40fac529d0d001db7673e4a83cb0f7fb594d12d7998faa
|
data/decktet.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.homepage = 'https://github.com/brodyf42/decktet'
|
|
10
10
|
spec.license = 'MIT'
|
|
11
11
|
|
|
12
|
-
spec.required_ruby_version = '>= 3.
|
|
12
|
+
spec.required_ruby_version = '>= 3.2.0'
|
|
13
13
|
|
|
14
14
|
# Specify which files should be added to the gem when it is released.
|
|
15
15
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/decktet/pile.rb
CHANGED
|
@@ -18,20 +18,20 @@ module Decktet
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def cut(depth=nil)
|
|
21
|
-
return self if
|
|
21
|
+
return self if size < 2
|
|
22
22
|
|
|
23
23
|
unless depth.nil?
|
|
24
24
|
raise ArgumentError.new('cut depth cannot be negative') if depth < 0
|
|
25
|
-
raise ArgumentError.new('cut depth cannot be greater than the number of cards') if depth >
|
|
25
|
+
raise ArgumentError.new('cut depth cannot be greater than the number of cards') if depth > size
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
depth ||= rand(1
|
|
28
|
+
depth ||= rand(1...size)
|
|
29
29
|
@cards.rotate!(depth)
|
|
30
30
|
self
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def draw(count=1)
|
|
34
|
-
unless count.between?(0
|
|
34
|
+
unless count.between?(0,size)
|
|
35
35
|
raise ArgumentError.new('draw amount cannot be negative or greater than the number of cards')
|
|
36
36
|
end
|
|
37
37
|
@cards.shift(count)
|
data/lib/decktet/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: decktet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brody Fischer
|
|
@@ -53,14 +53,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
53
53
|
requirements:
|
|
54
54
|
- - ">="
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
|
-
version: 3.
|
|
56
|
+
version: 3.2.0
|
|
57
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
59
|
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
61
|
version: '0'
|
|
62
62
|
requirements: []
|
|
63
|
-
rubygems_version:
|
|
63
|
+
rubygems_version: 4.0.16
|
|
64
64
|
specification_version: 4
|
|
65
65
|
summary: This gem provides an interface to the versatile decktet playing card system.
|
|
66
66
|
test_files: []
|