codebreakergem 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +14 -13
- data/.fasterer.yml +19 -19
- data/.gitignore +11 -11
- data/.rspec +3 -3
- data/.rubocop.yml +13 -8
- data/.ruby-version +1 -1
- data/.travis.yml +7 -7
- data/CODE_OF_CONDUCT.md +74 -74
- data/Gemfile +12 -11
- data/Gemfile.lock +75 -70
- data/LICENSE.txt +21 -21
- data/README.md +43 -43
- data/Rakefile +8 -8
- data/bin/console +15 -15
- data/bin/setup +8 -8
- data/codebreakergem.gemspec +39 -43
- data/lib/classes/difficulties/difficulty.rb +12 -12
- data/lib/classes/difficulties/easy.rb +12 -12
- data/lib/classes/difficulties/hell.rb +12 -12
- data/lib/classes/difficulties/medium.rb +12 -12
- data/lib/classes/file_worker.rb +29 -25
- data/lib/classes/game.rb +103 -116
- data/lib/classes/information_presenter.rb +32 -0
- data/lib/classes/user.rb +17 -17
- data/lib/codebreakergem.rb +19 -19
- data/lib/codebreakergem/version.rb +5 -5
- data/lib/config.rb +5 -5
- data/lib/locales/en.yml +53 -50
- data/lib/modules/check_module.rb +11 -11
- metadata +5 -5
- data/lib/classes/statistic.rb +0 -17
- data/lib/locales/ru.yml +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d000bb7d3edc9dafc91f5d395921c5bf268a0b621d312147ffbaa1adf51ec108
|
4
|
+
data.tar.gz: acb57275f03dca6ad27db4b07c0da1ec1a0fca33505bda6b4cbc20d7224bd04a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a20ddcbfb7465ccf148112030ac72689603cf3b770ed99f459f7a39635f9cd4c2c74652cfb5506ac6186bbe136c35c143efc4390b7c3febb695daeb0dfb18097
|
7
|
+
data.tar.gz: dc59c463f760cb8fc138d254cc1fd3866d2e1b3a3e54ae6eee0131eb71e5e9dee61f3cc22551479b30d861b66c89175d9484be17231542846f89c5a35cfddf7e
|
data/.circleci/config.yml
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
-
version: 2.0
|
2
|
-
jobs:
|
3
|
-
build:
|
4
|
-
branches:
|
5
|
-
only:
|
6
|
-
- codebreakergemrepo
|
7
|
-
docker:
|
8
|
-
- image: circleci/ruby:2.6.5
|
9
|
-
steps:
|
10
|
-
- checkout
|
11
|
-
- run: bundle install
|
12
|
-
- run: rubocop
|
13
|
-
- run: fasterer
|
1
|
+
version: 2.0
|
2
|
+
jobs:
|
3
|
+
build:
|
4
|
+
branches:
|
5
|
+
only:
|
6
|
+
- codebreakergemrepo
|
7
|
+
docker:
|
8
|
+
- image: circleci/ruby:2.6.5
|
9
|
+
steps:
|
10
|
+
- checkout
|
11
|
+
- run: bundle install
|
12
|
+
- run: rubocop
|
13
|
+
- run: fasterer
|
14
|
+
- run: rspec
|
data/.fasterer.yml
CHANGED
@@ -1,19 +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
|
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
@@ -1,11 +1,11 @@
|
|
1
|
-
/.bundle/
|
2
|
-
/.yardoc
|
3
|
-
/_yardoc/
|
4
|
-
/coverage/
|
5
|
-
/doc/
|
6
|
-
/pkg/
|
7
|
-
/spec/reports/
|
8
|
-
/tmp/
|
9
|
-
|
10
|
-
# rspec failure tracking
|
11
|
-
.rspec_status
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/_yardoc/
|
4
|
+
/coverage/
|
5
|
+
/doc/
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/tmp/
|
9
|
+
|
10
|
+
# rspec failure tracking
|
11
|
+
.rspec_status
|
data/.rspec
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
--format documentation
|
2
|
-
--color
|
3
|
-
--require spec_helper
|
1
|
+
--format documentation
|
2
|
+
--color
|
3
|
+
--require spec_helper
|
data/.rubocop.yml
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
-
Style/Documentation:
|
2
|
-
Enabled: false
|
3
|
-
|
4
|
-
Style/RaiseArgs:
|
5
|
-
EnforcedStyle: compact
|
6
|
-
|
7
|
-
Metrics/LineLength:
|
8
|
-
Max: 120
|
1
|
+
Style/Documentation:
|
2
|
+
Enabled: false
|
3
|
+
|
4
|
+
Style/RaiseArgs:
|
5
|
+
EnforcedStyle: compact
|
6
|
+
|
7
|
+
Metrics/LineLength:
|
8
|
+
Max: 120
|
9
|
+
|
10
|
+
Metrics/BlockLength:
|
11
|
+
Exclude:
|
12
|
+
- 'spec/spec_game.rb'
|
13
|
+
- 'spec/spec_information_presenter.rb'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.1p57
|
data/.travis.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
---
|
2
|
-
sudo: false
|
3
|
-
language: ruby
|
4
|
-
cache: bundler
|
5
|
-
rvm:
|
6
|
-
- 2.6.5
|
7
|
-
before_install: gem install bundler -v 1.17.2
|
1
|
+
---
|
2
|
+
sudo: false
|
3
|
+
language: ruby
|
4
|
+
cache: bundler
|
5
|
+
rvm:
|
6
|
+
- 2.6.5
|
7
|
+
before_install: gem install bundler -v 1.17.2
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,74 +1,74 @@
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
2
|
-
|
3
|
-
## Our Pledge
|
4
|
-
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
11
|
-
|
12
|
-
## Our Standards
|
13
|
-
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
15
|
-
include:
|
16
|
-
|
17
|
-
* Using welcoming and inclusive language
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
* Gracefully accepting constructive criticism
|
20
|
-
* Focusing on what is best for the community
|
21
|
-
* Showing empathy towards other community members
|
22
|
-
|
23
|
-
Examples of unacceptable behavior by participants include:
|
24
|
-
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
-
advances
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
-
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
30
|
-
address, without explicit permission
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
-
professional setting
|
33
|
-
|
34
|
-
## Our Responsibilities
|
35
|
-
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
39
|
-
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
45
|
-
|
46
|
-
## Scope
|
47
|
-
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
54
|
-
|
55
|
-
## Enforcement
|
56
|
-
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at sasha. All
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
63
|
-
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
66
|
-
members of the project's leadership.
|
67
|
-
|
68
|
-
## Attribution
|
69
|
-
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
-
|
73
|
-
[homepage]: http://contributor-covenant.org
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at sasha. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
gem 'byebug', '~> 9.0', '>= 9.0.6'
|
6
|
-
gem '
|
7
|
-
gem '
|
8
|
-
gem '
|
9
|
-
gem '
|
10
|
-
gem '
|
11
|
-
gem '
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
gem 'byebug', '~> 9.0', '>= 9.0.6'
|
6
|
+
gem 'faker', '~> 2.10'
|
7
|
+
gem 'fasterer', '~> 0.8.0'
|
8
|
+
gem 'i18n', '~> 1.7'
|
9
|
+
gem 'pry', '~> 0.10.3'
|
10
|
+
gem 'rspec', '~> 3.9'
|
11
|
+
gem 'rubocop', '~> 0.76.0'
|
12
|
+
gem 'simplecov', '~> 0.12.0'
|
data/Gemfile.lock
CHANGED
@@ -1,70 +1,75 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
ast (2.4.0)
|
5
|
-
byebug (9.1.0)
|
6
|
-
coderay (1.1.2)
|
7
|
-
colorize (0.8.1)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
rspec
|
30
|
-
rspec-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
simplecov
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
ast (2.4.0)
|
5
|
+
byebug (9.1.0)
|
6
|
+
coderay (1.1.2)
|
7
|
+
colorize (0.8.1)
|
8
|
+
concurrent-ruby (1.1.5)
|
9
|
+
diff-lcs (1.3)
|
10
|
+
docile (1.1.5)
|
11
|
+
faker (2.10.0)
|
12
|
+
i18n (>= 1.6, < 1.8)
|
13
|
+
fasterer (0.8.1)
|
14
|
+
colorize (~> 0.7)
|
15
|
+
ruby_parser (>= 3.14.1)
|
16
|
+
i18n (1.7.0)
|
17
|
+
concurrent-ruby (~> 1.0)
|
18
|
+
jaro_winkler (1.5.4)
|
19
|
+
json (2.3.0)
|
20
|
+
method_source (0.8.2)
|
21
|
+
parallel (1.19.1)
|
22
|
+
parser (2.7.0.1)
|
23
|
+
ast (~> 2.4.0)
|
24
|
+
pry (0.10.4)
|
25
|
+
coderay (~> 1.1.0)
|
26
|
+
method_source (~> 0.8.1)
|
27
|
+
slop (~> 3.4)
|
28
|
+
rainbow (3.0.0)
|
29
|
+
rspec (3.9.0)
|
30
|
+
rspec-core (~> 3.9.0)
|
31
|
+
rspec-expectations (~> 3.9.0)
|
32
|
+
rspec-mocks (~> 3.9.0)
|
33
|
+
rspec-core (3.9.1)
|
34
|
+
rspec-support (~> 3.9.1)
|
35
|
+
rspec-expectations (3.9.0)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.9.0)
|
38
|
+
rspec-mocks (3.9.1)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.9.0)
|
41
|
+
rspec-support (3.9.2)
|
42
|
+
rubocop (0.76.0)
|
43
|
+
jaro_winkler (~> 1.5.1)
|
44
|
+
parallel (~> 1.10)
|
45
|
+
parser (>= 2.6)
|
46
|
+
rainbow (>= 2.2.2, < 4.0)
|
47
|
+
ruby-progressbar (~> 1.7)
|
48
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
49
|
+
ruby-progressbar (1.10.1)
|
50
|
+
ruby_parser (3.14.1)
|
51
|
+
sexp_processor (~> 4.9)
|
52
|
+
sexp_processor (4.13.0)
|
53
|
+
simplecov (0.12.0)
|
54
|
+
docile (~> 1.1.0)
|
55
|
+
json (>= 1.8, < 3)
|
56
|
+
simplecov-html (~> 0.10.0)
|
57
|
+
simplecov-html (0.10.2)
|
58
|
+
slop (3.6.0)
|
59
|
+
unicode-display_width (1.6.0)
|
60
|
+
|
61
|
+
PLATFORMS
|
62
|
+
ruby
|
63
|
+
|
64
|
+
DEPENDENCIES
|
65
|
+
byebug (~> 9.0, >= 9.0.6)
|
66
|
+
faker (~> 2.10)
|
67
|
+
fasterer (~> 0.8.0)
|
68
|
+
i18n (~> 1.7)
|
69
|
+
pry (~> 0.10.3)
|
70
|
+
rspec (~> 3.9)
|
71
|
+
rubocop (~> 0.76.0)
|
72
|
+
simplecov (~> 0.12.0)
|
73
|
+
|
74
|
+
BUNDLED WITH
|
75
|
+
1.16.1
|