icodebreaker_gem 0.3.3 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec_status +22 -22
- data/Gemfile.lock +2 -1
- data/lib/game_core.rb +2 -1
- data/lib/icodebreaker_gem/version.rb +1 -1
- data/lib/icodebreaker_gem.rb +1 -1
- data/lib/modules/storage.rb +11 -9
- 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: 105bfdc91ba47ae3170367f67b7ad1d54929eb614d629b81539f8c7bb7ec2236
|
4
|
+
data.tar.gz: d8fa3703fda620db1156f2c7de4d4690ac0e2c27ae877cbec094820ad61af44a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00e9bc0f6f4af675337fa81d1838f154289b5ca5ceee4cff502f4bbe558849be86be7d651689afba45e836f8dd95680d99845e8dbe3395157d1366b849338bbb
|
7
|
+
data.tar.gz: a38c732d74afea64c2ed27190746e39e5311f3635e16d5f3642c813f4a598f71f00ab2fb39f4359ac77c5dc096b703f7d6a737624d72e30caa87a808ffc1bec3
|
data/.rspec_status
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
------------------------------------ | ------ | --------------- |
|
3
|
-
./spec/game_core_spec.rb[1:1] | passed | 0.
|
4
|
-
./spec/game_core_spec.rb[1:2] | passed | 0.
|
5
|
-
./spec/game_core_spec.rb[1:3:1] | passed | 0.
|
6
|
-
./spec/game_core_spec.rb[1:4:1] | passed | 0.
|
7
|
-
./spec/game_core_spec.rb[1:5:1:1] | passed | 0.
|
8
|
-
./spec/game_core_spec.rb[1:5:1:2] | passed | 0.
|
9
|
-
./spec/game_core_spec.rb[1:5:1:3] | passed | 0.
|
10
|
-
./spec/game_core_spec.rb[1:5:1:4] | passed | 0.
|
11
|
-
./spec/game_core_spec.rb[1:5:1:5] | passed | 0.
|
12
|
-
./spec/game_core_spec.rb[1:5:1:6] | passed | 0.
|
13
|
-
./spec/game_core_spec.rb[1:5:1:7] | passed | 0.
|
3
|
+
./spec/game_core_spec.rb[1:1] | passed | 0.00038 seconds |
|
4
|
+
./spec/game_core_spec.rb[1:2] | passed | 0.00086 seconds |
|
5
|
+
./spec/game_core_spec.rb[1:3:1] | passed | 0.00057 seconds |
|
6
|
+
./spec/game_core_spec.rb[1:4:1] | passed | 0.00072 seconds |
|
7
|
+
./spec/game_core_spec.rb[1:5:1:1] | passed | 0.00009 seconds |
|
8
|
+
./spec/game_core_spec.rb[1:5:1:2] | passed | 0.00009 seconds |
|
9
|
+
./spec/game_core_spec.rb[1:5:1:3] | passed | 0.00011 seconds |
|
10
|
+
./spec/game_core_spec.rb[1:5:1:4] | passed | 0.00006 seconds |
|
11
|
+
./spec/game_core_spec.rb[1:5:1:5] | passed | 0.00005 seconds |
|
12
|
+
./spec/game_core_spec.rb[1:5:1:6] | passed | 0.00009 seconds |
|
13
|
+
./spec/game_core_spec.rb[1:5:1:7] | passed | 0.00006 seconds |
|
14
14
|
./spec/game_core_spec.rb[1:5:2:1] | passed | 0.00008 seconds |
|
15
15
|
./spec/game_core_spec.rb[1:5:2:2] | passed | 0.00005 seconds |
|
16
16
|
./spec/game_core_spec.rb[1:5:3:1] | passed | 0.00005 seconds |
|
17
|
-
./spec/game_core_spec.rb[1:5:3:2] | passed | 0.
|
17
|
+
./spec/game_core_spec.rb[1:5:3:2] | passed | 0.00005 seconds |
|
18
18
|
./spec/game_core_spec.rb[1:5:3:3] | passed | 0.00004 seconds |
|
19
|
-
./spec/game_spec.rb[1:1:1] | passed | 0.
|
20
|
-
./spec/game_spec.rb[1:2:1] | passed | 0.
|
21
|
-
./spec/game_spec.rb[1:2:2] | passed | 0.
|
22
|
-
./spec/game_spec.rb[1:2:3] | passed | 0.
|
19
|
+
./spec/game_spec.rb[1:1:1] | passed | 0.0001 seconds |
|
20
|
+
./spec/game_spec.rb[1:2:1] | passed | 0.00021 seconds |
|
21
|
+
./spec/game_spec.rb[1:2:2] | passed | 0.00012 seconds |
|
22
|
+
./spec/game_spec.rb[1:2:3] | passed | 0.0001 seconds |
|
23
23
|
./spec/game_spec.rb[1:2:4] | passed | 0.00006 seconds |
|
24
24
|
./spec/game_spec.rb[1:2:5] | passed | 0.00005 seconds |
|
25
|
-
./spec/game_spec.rb[1:3:1] | passed | 0.
|
26
|
-
./spec/game_spec.rb[1:3:2] | passed | 0.
|
27
|
-
./spec/game_spec.rb[1:3:3] | passed | 0.
|
28
|
-
./spec/game_spec.rb[1:4:1] | passed | 0.
|
29
|
-
./spec/game_spec.rb[1:5:1] | passed | 0.
|
30
|
-
./spec/icodebreaker_gem_spec.rb[1:1] | passed | 0.
|
25
|
+
./spec/game_spec.rb[1:3:1] | passed | 0.00051 seconds |
|
26
|
+
./spec/game_spec.rb[1:3:2] | passed | 0.00017 seconds |
|
27
|
+
./spec/game_spec.rb[1:3:3] | passed | 0.00014 seconds |
|
28
|
+
./spec/game_spec.rb[1:4:1] | passed | 0.00376 seconds |
|
29
|
+
./spec/game_spec.rb[1:5:1] | passed | 0.00123 seconds |
|
30
|
+
./spec/icodebreaker_gem_spec.rb[1:1] | passed | 0.00007 seconds |
|
data/Gemfile.lock
CHANGED
data/lib/game_core.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
module IcodebreakerGem
|
4
4
|
class GameCore
|
5
5
|
include Validation
|
6
|
+
attr_reader :secret
|
6
7
|
|
7
8
|
def initialize(secret)
|
8
9
|
validate_code secret
|
@@ -21,7 +22,7 @@ module IcodebreakerGem
|
|
21
22
|
|
22
23
|
'+' * [pluses1, pluses2].min + '-' * [minuses1, minuses2].min
|
23
24
|
end
|
24
|
-
|
25
|
+
|
25
26
|
def hint
|
26
27
|
@shuffle.pop
|
27
28
|
end
|
data/lib/icodebreaker_gem.rb
CHANGED
data/lib/modules/storage.rb
CHANGED
@@ -4,18 +4,20 @@ module IcodebreakerGem
|
|
4
4
|
module Storage
|
5
5
|
DATA_FILE = 'codebreakers.yml'
|
6
6
|
STORAGE_PATH = './storage/'
|
7
|
-
|
8
|
-
create_storage
|
9
|
-
games = load_storage
|
10
|
-
games << game
|
11
|
-
File.open(data_path, 'w') do |file|
|
12
|
-
YAML.dump(games, file)
|
13
|
-
end
|
14
|
-
end
|
7
|
+
|
15
8
|
class << self
|
9
|
+
def save_storage(game)
|
10
|
+
create_storage
|
11
|
+
games = load_storage
|
12
|
+
games << game
|
13
|
+
File.open(data_path, 'w') do |file|
|
14
|
+
YAML.dump(games, file)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
16
18
|
def load_storage
|
17
19
|
create_storage
|
18
|
-
YAML.
|
20
|
+
YAML.load(File.read(data_path)) || []
|
19
21
|
end
|
20
22
|
|
21
23
|
def sort_codebreakers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: icodebreaker_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JohnnyGsy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
|
-
rubygems_version: 3.2
|
161
|
+
rubygems_version: 3.1.2
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: The codebreaker game.
|