codebreaker2018 0.3.4.1 → 0.3.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b04954e04d347f9858b32f2cc7a336818cc2f0a3476cd5b9b30593ad3792a13
4
- data.tar.gz: ebbeffa08d529b62175c7a1ce2a2b5d2295f23ec47dbc238f53a64f1fb61e8ba
3
+ metadata.gz: a5f8870aa186256c3bf435c3bedbedc9f3acbfe6dbeab6cabb7561096dd47ce1
4
+ data.tar.gz: f90c5f18c25194c6bd4020a7e9a16f1da59cb223813d12a2bb27a9f7cb39a5b3
5
5
  SHA512:
6
- metadata.gz: 5db6eda2b50c887e7e971bf8d4622988eb42d25e626a0f34acfa5cd31d2349eae604382efba0b8af1c6e788348a90e209c49652850fac98fde85d32c8ad2a5da
7
- data.tar.gz: 181037befd593445d4f6fee9b68f90aebeef6514c14412b85fbb2be95717d4e4461daf23d86004b19c5cc5be7d60efe615813550ff36165f464ce8fed18051de
6
+ metadata.gz: 570b8359fc5cc3ffe4782b3a55e3da6719ce67d5699538662be2a6bbb92bc62f23996a46f3adcecbaca8a5c5efd6e41db4aa2c6baf01cf110391632126c0d984
7
+ data.tar.gz: 5583cda2e4794cc6bc6643ed61f7467220b955eef740769f5b48984c15676ad7542749a59d9916aef43bcf2e682f41b58985c24b18e2bf59cc922b1b15cee930
@@ -48,7 +48,9 @@ module Codebreaker
48
48
  private
49
49
 
50
50
  def check_configuration
51
+ levels = [SIMPLE_LEVEL, MIDDLE_LEVEL, HARD_LEVEL]
51
52
  raise message['errors']['fail_configuration'] if configuration.any?(&:nil?)
53
+ raise message['errors']['unknown_level'] unless levels.include?(configuration.level)
52
54
  begin
53
55
  raise if configuration.max_attempts < 1 || configuration.max_hints.negative?
54
56
  rescue
@@ -106,8 +108,7 @@ module Codebreaker
106
108
  level_rates = case configuration.level
107
109
  when SIMPLE_LEVEL then [TEN_POINTS, ZERO_POINTS]
108
110
  when MIDDLE_LEVEL then [TWENTY_POINTS, TWENTY_POINTS]
109
- when HARD_LEVEL then [FIFTY_POINTS, ONE_HUNDRED_POINTS]
110
- else raise message['errors']['unknown_level']
111
+ else [FIFTY_POINTS, ONE_HUNDRED_POINTS]
111
112
  end
112
113
 
113
114
  attempt_rate, hint_rate = level_rates
@@ -1,3 +1,3 @@
1
1
  module Codebreaker
2
- VERSION = '0.3.4.1'
2
+ VERSION = '0.3.4.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codebreaker2018
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4.1
4
+ version: 0.3.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Trotsenko
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-29 00:00:00.000000000 Z
11
+ date: 2018-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize