icodebreaker_gem 0.2.1 → 0.2.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: a26dbd32094d9d175bee55733d644f79d40c354904db392cc1d31dd758dbcf12
4
- data.tar.gz: 16b204cbb75974cbca40f17d5e48379581d90eab036dd3eaa02b96f42b3345fa
3
+ metadata.gz: 042dbedd8e000d620a90aa17a91afc3f08bd64e486e7e06df12a409919503d57
4
+ data.tar.gz: 40b79540a1bb21afb573b0ae671bb7d9fb05ccd53e6d82f33287a961329106f6
5
5
  SHA512:
6
- metadata.gz: d38aef1d318ea88267efb1bd383a61e9cb1eb53f4f9dbc32ca7c1405f764036658dae0a8a3aa95521444e21c1e65f46ce2ad1f7915a3609a8ef70c5be5778bba
7
- data.tar.gz: ab60550f3c436e404b26c1929c7733e4a6275172706b28b813ea0e0d37f221761b909b4742dfdd3ae7f5b05d9d85595eaee0b083f3d04fdc5861c2fac76df57d
6
+ metadata.gz: 600c4497bd0c6af0cb66ce0e6d26c8c4f8da62cb15b8b136ab4217676d8c74d137c904d7142c2077cec076e549b534d737cefb25c690d19a8c1db04132979642
7
+ data.tar.gz: 15f30eeb6037b8329fba8f12baeaadb1c6a10158ab14fa5dc17fdb697815149e0f0e724cd3b012df4afb019c7d581f7f20844153f628fd0b7f3e8d858fcde79b
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.00038 seconds |
4
- ./spec/game_core_spec.rb[1:2] | passed | 0.00089 seconds |
5
- ./spec/game_core_spec.rb[1:3:1] | passed | 0.00064 seconds |
6
- ./spec/game_core_spec.rb[1:4:1] | passed | 0.00078 seconds |
7
- ./spec/game_core_spec.rb[1:5:1:1] | passed | 0.00011 seconds |
3
+ ./spec/game_core_spec.rb[1:1] | passed | 0.00023 seconds |
4
+ ./spec/game_core_spec.rb[1:2] | passed | 0.00073 seconds |
5
+ ./spec/game_core_spec.rb[1:3:1] | passed | 0.00034 seconds |
6
+ ./spec/game_core_spec.rb[1:4:1] | passed | 0.00055 seconds |
7
+ ./spec/game_core_spec.rb[1:5:1:1] | passed | 0.00008 seconds |
8
8
  ./spec/game_core_spec.rb[1:5:1:2] | passed | 0.0001 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.00015 seconds |
9
+ ./spec/game_core_spec.rb[1:5:1:3] | passed | 0.00008 seconds |
10
+ ./spec/game_core_spec.rb[1:5:1:4] | passed | 0.0001 seconds |
11
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.00007 seconds |
12
+ ./spec/game_core_spec.rb[1:5:1:6] | passed | 0.00005 seconds |
13
13
  ./spec/game_core_spec.rb[1:5:1:7] | passed | 0.00004 seconds |
14
14
  ./spec/game_core_spec.rb[1:5:2:1] | passed | 0.00005 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.00006 seconds |
18
- ./spec/game_core_spec.rb[1:5:3:3] | passed | 0.00004 seconds |
19
- ./spec/game_spec.rb[1:1:1] | passed | 0.00012 seconds |
17
+ ./spec/game_core_spec.rb[1:5:3:2] | passed | 0.00005 seconds |
18
+ ./spec/game_core_spec.rb[1:5:3:3] | passed | 0.00007 seconds |
19
+ ./spec/game_spec.rb[1:1:1] | passed | 0.00013 seconds |
20
20
  ./spec/game_spec.rb[1:2:1] | passed | 0.00025 seconds |
21
- ./spec/game_spec.rb[1:2:2] | passed | 0.00007 seconds |
22
- ./spec/game_spec.rb[1:2:3] | passed | 0.00008 seconds |
23
- ./spec/game_spec.rb[1:2:4] | passed | 0.00007 seconds |
24
- ./spec/game_spec.rb[1:2:5] | passed | 0.00008 seconds |
25
- ./spec/game_spec.rb[1:3:1] | passed | 0.00058 seconds |
26
- ./spec/game_spec.rb[1:3:2] | passed | 0.0002 seconds |
21
+ ./spec/game_spec.rb[1:2:2] | passed | 0.00006 seconds |
22
+ ./spec/game_spec.rb[1:2:3] | passed | 0.00006 seconds |
23
+ ./spec/game_spec.rb[1:2:4] | passed | 0.00006 seconds |
24
+ ./spec/game_spec.rb[1:2:5] | passed | 0.00006 seconds |
25
+ ./spec/game_spec.rb[1:3:1] | passed | 0.00039 seconds |
26
+ ./spec/game_spec.rb[1:3:2] | passed | 0.00018 seconds |
27
27
  ./spec/game_spec.rb[1:3:3] | passed | 0.00014 seconds |
28
- ./spec/game_spec.rb[1:4:1] | passed | 0.00012 seconds |
29
- ./spec/game_spec.rb[1:5:1] | passed | 0.0014 seconds |
30
- ./spec/icodebreaker_gem_spec.rb[1:1] | passed | 0.0001 seconds |
28
+ ./spec/game_spec.rb[1:4:1] | passed | 0.00011 seconds |
29
+ ./spec/game_spec.rb[1:5:1] | passed | 0.00112 seconds |
30
+ ./spec/icodebreaker_gem_spec.rb[1:1] | passed | 0.00008 seconds |
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- icodebreaker_gem (0.2.1)
4
+ icodebreaker_gem (0.2.2)
5
5
  rake (~> 13.0)
6
6
 
7
7
  GEM
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IcodebreakerGem
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
  end
@@ -12,27 +12,28 @@ module IcodebreakerGem
12
12
  YAML.dump(games, file)
13
13
  end
14
14
  end
15
+ class << self
16
+ def load_storage
17
+ create_storage
18
+ YAML.load(File.read(data_path)) || []
19
+ end
15
20
 
16
- def load_storage
17
- create_storage
18
- YAML.load(File.read(data_path)) || []
19
- end
20
-
21
- def sort_codebreakers
22
- load_storage.sort_by do |statistic|
23
- [statistic[:attempts_total], statistic[:attempts_used], statistic[:hints_used]]
21
+ def sort_codebreakers
22
+ load_storage.sort_by do |statistic|
23
+ [statistic[:attempts_total], statistic[:attempts_used], statistic[:hints_used]]
24
+ end
24
25
  end
25
- end
26
26
 
27
- private
27
+ private
28
28
 
29
- def data_path
30
- STORAGE_PATH + DATA_FILE
31
- end
29
+ def data_path
30
+ STORAGE_PATH + DATA_FILE
31
+ end
32
32
 
33
- def create_storage
34
- Dir.mkdir(STORAGE_PATH) unless File.exist?(STORAGE_PATH)
35
- File.open(data_path, 'w') unless File.exist?(data_path)
33
+ def create_storage
34
+ Dir.mkdir(STORAGE_PATH) unless File.exist?(STORAGE_PATH)
35
+ File.open(data_path, 'w') unless File.exist?(data_path)
36
+ end
36
37
  end
37
38
  end
38
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icodebreaker_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JohnnyGsy