codebreaker_kub 0.1.5 → 0.1.6
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 +57 -0
- data/.gitignore +1 -2
- data/lib/codebreaker/data/locales/en.yml +1 -0
- data/lib/codebreaker/output.rb +13 -3
- data/lib/codebreaker/version.rb +1 -1
- data/pkg/codebreaker_kub-0.0.1.gem +0 -0
- 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: 3a49f0af67627baefe1e347796218ea5ea54d8155e1187ded572e04c28729c0f
|
4
|
+
data.tar.gz: f4d02d1790d23a479d48f3f24d2e62a20264d231c42c3d7a6c23a1a2532aabd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10154c1f27c0dcb29b36280731de9b3c261eb69e5aebab8947f519a70012e035126f2f412be3bef4d70f41533b4432f23c88e5b88385d1ec00ac8566e22a6359
|
7
|
+
data.tar.gz: 7a3f12d5f012885f3a0a89e940f5515f4569f0200e31f8bccf301ffdb241496b6388d1ad1c88ba14be31ea063893a689d1fffc74a22690d69ef8a89e2b21e16c
|
@@ -0,0 +1,57 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
executors:
|
4
|
+
default:
|
5
|
+
working_directory: ~/repo
|
6
|
+
description: The official CircleCI Ruby Docker image
|
7
|
+
docker:
|
8
|
+
- image: circleci/ruby:2.7.0
|
9
|
+
caches:
|
10
|
+
- &bundle_cache v1-repo-{{ checksum "Gemfile.lock" }}
|
11
|
+
commands:
|
12
|
+
run_linters:
|
13
|
+
description: command to start linters
|
14
|
+
steps:
|
15
|
+
- run:
|
16
|
+
name: rubocop
|
17
|
+
command: bundle exec rubocop
|
18
|
+
run_specs:
|
19
|
+
steps:
|
20
|
+
- run:
|
21
|
+
name: run specs
|
22
|
+
command: |
|
23
|
+
mkdir /tmp/test-results
|
24
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
25
|
+
bundle exec rspec --format progress \
|
26
|
+
--out /tmp/test-results/rspec.xml \
|
27
|
+
$TEST_FILES
|
28
|
+
setup_environment:
|
29
|
+
steps:
|
30
|
+
- checkout
|
31
|
+
- restore_cache:
|
32
|
+
key: *bundle_cache
|
33
|
+
- run: bundle install --path vendor/bundle
|
34
|
+
- save_cache:
|
35
|
+
key: *bundle_cache
|
36
|
+
paths:
|
37
|
+
- vendor/bundle
|
38
|
+
jobs:
|
39
|
+
lintering:
|
40
|
+
executor: default
|
41
|
+
steps:
|
42
|
+
- setup_environment
|
43
|
+
- run_linters
|
44
|
+
run_specs:
|
45
|
+
executor: default
|
46
|
+
steps:
|
47
|
+
- setup_environment
|
48
|
+
- run_specs
|
49
|
+
|
50
|
+
workflows:
|
51
|
+
version: 2
|
52
|
+
build:
|
53
|
+
jobs:
|
54
|
+
- lintering
|
55
|
+
- run_specs:
|
56
|
+
requires:
|
57
|
+
- lintering
|
data/.gitignore
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
- Load game statistics - puts 'stats'\n
|
6
6
|
- Exit from game - puts 'exit'\n"
|
7
7
|
goodbye: "Bye bye!\n"
|
8
|
+
available_commands: "Enter 'start', 'rules', 'stats' or 'exit'"
|
8
9
|
rules: "GAME RULES:\n
|
9
10
|
# Codebreaker is a logic game in which a code-breaker tries to break a secret code created by a code-maker. The\n codemaker, which will be played by the application we’re going to write, creates a secret code.\n
|
10
11
|
# The codebreaker gets some number of chances to break the code (depends on chosen difficulty). In each turn, the\n codebreaker makes a guess. The codemaker then marks the guess with special symbols.\n
|
data/lib/codebreaker/output.rb
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
module Codebreaker
|
2
2
|
class Output
|
3
|
+
attr_reader :stats
|
3
4
|
def initialize
|
4
5
|
I18n.load_path << Dir[File.expand_path(File.join(File.dirname(__FILE__), 'data/locales/')) + '/*.yml']
|
5
6
|
I18n.config.available_locales = :en
|
7
|
+
@stats = Codebreaker::Loader.load('stat')
|
6
8
|
end
|
7
9
|
|
8
10
|
def greeting
|
9
11
|
puts I18n.t(:hey)
|
10
12
|
end
|
11
13
|
|
14
|
+
def available_commands
|
15
|
+
puts I18n.t(:available_commands)
|
16
|
+
end
|
17
|
+
|
12
18
|
def choose_name
|
13
19
|
puts I18n.t(:choose_name)
|
14
20
|
end
|
@@ -22,11 +28,15 @@ module Codebreaker
|
|
22
28
|
end
|
23
29
|
|
24
30
|
def show_stats
|
25
|
-
stats.each do |game|
|
31
|
+
@stats.each do |game|
|
26
32
|
puts "Hey, #{game[:name]}
|
27
|
-
Chosen difficulty: #{game[:difficulty]}
|
28
33
|
Attempts: #{game[:attempts]}
|
29
|
-
Hints: #{game[:hints]}
|
34
|
+
Hints: #{game[:hints]}
|
35
|
+
Code: #{game[:code]}
|
36
|
+
Chosen difficulty: #{game[:difficulty]}
|
37
|
+
Unused attempts: #{game[:attempts_left]}
|
38
|
+
Unused hints: #{game[:hints_left]}
|
39
|
+
Win: #{game[:win]}"
|
30
40
|
end
|
31
41
|
end
|
32
42
|
|
data/lib/codebreaker/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebreaker_kub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- katia kub
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fasterer
|
@@ -87,10 +87,10 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
+
- ".circleci/config.yml"
|
90
91
|
- ".fasterer.yml"
|
91
92
|
- ".gitignore"
|
92
93
|
- ".overcommit.yml"
|
93
|
-
- ".rspec_status"
|
94
94
|
- ".rubocop.yml"
|
95
95
|
- ".ruby-version"
|
96
96
|
- CODE_OF_CONDUCT.md
|