GemCodebreaker 0.1.4 → 0.1.5
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/.circleci/config.yml +1 -1
- data/.fasterer.yml +19 -0
- data/.gitignore +0 -1
- data/Gemfile.lock +74 -0
- data/lib/GemCodebreaker/classes/game_config.rb +1 -2
- data/lib/GemCodebreaker/classes/game_statistic.rb +1 -3
- data/lib/GemCodebreaker/modules/game_configurations.rb +0 -4
- data/lib/GemCodebreaker/modules/serializer_deserializer.rb +1 -1
- data/lib/GemCodebreaker/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f0aed222de26843d9e2628824cacab6d5828f5877023d53407c24147548954e
|
4
|
+
data.tar.gz: 3027c48c3a319170f1ffd3790e55c3284b755cb19aebf6b72a07300282aa640a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cb6ad1dae12a142330cae104a3cf06bb1413c64c07529d6fcf9930478f8c80e1aba3eadbfa517eca5dea4de44036288a16c329f79798ffd7d19278571038e62
|
7
|
+
data.tar.gz: ca115498fb153ae9b884de1f61b24e2d64ef2557fbcc62124145ea7e594a0d9203aaa282846b55f4f0fc2474d3f4a3a3a6df0f1baf5506b26b99aa8f3deef87b
|
data/.circleci/config.yml
CHANGED
data/.fasterer.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
speedups:
|
2
|
+
rescue_vs_respond_to: true
|
3
|
+
module_eval: true
|
4
|
+
shuffle_first_vs_sample: true
|
5
|
+
for_loop_vs_each: true
|
6
|
+
each_with_index_vs_while: false
|
7
|
+
map_flatten_vs_flat_map: true
|
8
|
+
reverse_each_vs_reverse_each: true
|
9
|
+
select_first_vs_detect: true
|
10
|
+
sort_vs_sort_by: true
|
11
|
+
fetch_with_argument_vs_block: true
|
12
|
+
keys_each_vs_each_key: true
|
13
|
+
hash_merge_bang_vs_hash_brackets: true
|
14
|
+
block_vs_symbol_to_proc: true
|
15
|
+
proc_call_vs_yield: true
|
16
|
+
gsub_vs_tr: true
|
17
|
+
select_last_vs_reverse_detect: true
|
18
|
+
getter_vs_attr_reader: true
|
19
|
+
setter_vs_attr_writer: true
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
GemCodebreaker (0.1.5)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.1)
|
10
|
+
colorize (0.8.1)
|
11
|
+
concurrent-ruby (1.1.6)
|
12
|
+
diff-lcs (1.3)
|
13
|
+
docile (1.3.2)
|
14
|
+
fasterer (0.8.3)
|
15
|
+
colorize (~> 0.7)
|
16
|
+
ruby_parser (>= 3.14.1)
|
17
|
+
i18n (1.8.3)
|
18
|
+
concurrent-ruby (~> 1.0)
|
19
|
+
parallel (1.19.2)
|
20
|
+
parser (2.7.1.3)
|
21
|
+
ast (~> 2.4.0)
|
22
|
+
rainbow (3.0.0)
|
23
|
+
rake (13.0.1)
|
24
|
+
rexml (3.2.4)
|
25
|
+
rspec (3.7.0)
|
26
|
+
rspec-core (~> 3.7.0)
|
27
|
+
rspec-expectations (~> 3.7.0)
|
28
|
+
rspec-mocks (~> 3.7.0)
|
29
|
+
rspec-core (3.7.1)
|
30
|
+
rspec-support (~> 3.7.0)
|
31
|
+
rspec-expectations (3.7.0)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.7.0)
|
34
|
+
rspec-mocks (3.7.0)
|
35
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
+
rspec-support (~> 3.7.0)
|
37
|
+
rspec-support (3.7.1)
|
38
|
+
rubocop (0.84.0)
|
39
|
+
parallel (~> 1.10)
|
40
|
+
parser (>= 2.7.0.1)
|
41
|
+
rainbow (>= 2.2.2, < 4.0)
|
42
|
+
rexml
|
43
|
+
rubocop-ast (>= 0.0.3)
|
44
|
+
ruby-progressbar (~> 1.7)
|
45
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
46
|
+
rubocop-ast (0.0.3)
|
47
|
+
parser (>= 2.7.0.1)
|
48
|
+
rubocop-rspec (1.41.0)
|
49
|
+
rubocop (>= 0.68.1)
|
50
|
+
ruby-progressbar (1.10.1)
|
51
|
+
ruby_parser (3.14.2)
|
52
|
+
sexp_processor (~> 4.9)
|
53
|
+
sexp_processor (4.15.0)
|
54
|
+
simplecov (0.18.5)
|
55
|
+
docile (~> 1.1)
|
56
|
+
simplecov-html (~> 0.11)
|
57
|
+
simplecov-html (0.12.2)
|
58
|
+
unicode-display_width (1.7.0)
|
59
|
+
|
60
|
+
PLATFORMS
|
61
|
+
ruby
|
62
|
+
|
63
|
+
DEPENDENCIES
|
64
|
+
GemCodebreaker!
|
65
|
+
fasterer (~> 0.8.3)
|
66
|
+
i18n (~> 1.8.3)
|
67
|
+
rake (~> 13.0.1)
|
68
|
+
rspec (~> 3.7.0)
|
69
|
+
rubocop (~> 0.84.0)
|
70
|
+
rubocop-rspec (~> 1.41.0)
|
71
|
+
simplecov (~> 0.18.5)
|
72
|
+
|
73
|
+
BUNDLED WITH
|
74
|
+
2.1.4
|
@@ -4,7 +4,7 @@ module GemCodebreaker
|
|
4
4
|
# Configuration class for game
|
5
5
|
class GameConfig
|
6
6
|
include GameConfigurations
|
7
|
-
attr_reader :user_attempts, :user_hints
|
7
|
+
attr_reader :user_attempts, :user_hints
|
8
8
|
attr_accessor :user_nick_name, :difficulty, :max_attempts, :max_hints
|
9
9
|
|
10
10
|
def initialize(user, level)
|
@@ -12,7 +12,6 @@ module GemCodebreaker
|
|
12
12
|
@difficulty = level
|
13
13
|
@max_attempts = GAME_LEVEL[level][:attempts]
|
14
14
|
@max_hints = GAME_LEVEL[level][:hints]
|
15
|
-
@difficulty_priority = GAME_LEVEL_PRIORITY[level]
|
16
15
|
@user_attempts = 0
|
17
16
|
@user_hints = 0
|
18
17
|
end
|
@@ -3,8 +3,7 @@
|
|
3
3
|
module GemCodebreaker
|
4
4
|
# Game statistic class
|
5
5
|
class GameStatistic
|
6
|
-
attr_reader :user_nickname, :difficulty, :attempts_total, :attempts_used, :hints_total, :hints_used
|
7
|
-
:difficulty_priority
|
6
|
+
attr_reader :user_nickname, :difficulty, :attempts_total, :attempts_used, :hints_total, :hints_used
|
8
7
|
|
9
8
|
def initialize(game)
|
10
9
|
@user_nickname = game.config.user_nick_name
|
@@ -13,7 +12,6 @@ module GemCodebreaker
|
|
13
12
|
@attempts_used = game.attempts
|
14
13
|
@hints_total = game.config.max_hints
|
15
14
|
@hints_used = game.hints
|
16
|
-
@difficulty_priority = game.config.difficulty_priority
|
17
15
|
end
|
18
16
|
end
|
19
17
|
end
|
@@ -5,7 +5,7 @@ module GemCodebreaker
|
|
5
5
|
module SerializerDeserializer
|
6
6
|
FILE_NAME = 'game_statistic.yml'
|
7
7
|
STATISTIC_DIR = 'data'
|
8
|
-
STORAGE_PATH = File.expand_path("./#{STATISTIC_DIR}/#{FILE_NAME}"
|
8
|
+
STORAGE_PATH = File.expand_path("./#{STATISTIC_DIR}/#{FILE_NAME}")
|
9
9
|
|
10
10
|
def data_dir_get
|
11
11
|
data_directory = File.dirname(STORAGE_PATH)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: GemCodebreaker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vasyl
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fasterer
|
@@ -116,11 +116,13 @@ extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
118
|
- ".circleci/config.yml"
|
119
|
+
- ".fasterer.yml"
|
119
120
|
- ".gitignore"
|
120
121
|
- ".rspec"
|
121
122
|
- ".rubocop.yml"
|
122
123
|
- GemCodebreaker.gemspec
|
123
124
|
- Gemfile
|
125
|
+
- Gemfile.lock
|
124
126
|
- LICENSE.txt
|
125
127
|
- README.md
|
126
128
|
- bin/console.rb
|