codebraker_ov 0.0.4 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 926a976fc8499b07d38a9c5b360a71e8f8cf4296aacdc78624da3824ab673ca2
4
- data.tar.gz: 40f909df5199d0c9e2b5f02833d4ce9055f77dd03ba34ffc504a56b9f4ab9771
3
+ metadata.gz: c9e6c5632d22bce6c92091fbdd91d621699fc13076b3985a87a25f6e280579f8
4
+ data.tar.gz: 8bf77dea90ecba3bc53e4b996d6327d0ef5f61251cf15753d64b9194abd06e3c
5
5
  SHA512:
6
- metadata.gz: 9d62485f13536c2959b49c4de3b58ba30b14180cca08ed72472d30b5d5ac4117b0741e5a9475d7fd95cf4b1002dec3d3a8672e96ed92d5b5222f0f6a720db3ca
7
- data.tar.gz: c95bb83ad17075b0e93228b2f05e54fa583827facdaaf0d6b6dd1735afbc51f2d0519d62c76d2d787318479ad2d611dfeafd77cd732f11fcd8ed0fe32b91dcd7
6
+ metadata.gz: 027d5f68616518771b9b1df4dc2a49a1f7a5f2fe7bb54e67aab6c80b4bffe06bd199b0990fa3dd849f52c95264b1ea5b854de53ce1f9b80fa7506b9f72d4988b
7
+ data.tar.gz: d515ee2bc6b6b1c118b2666eddb54eb053f46f14aa1fadb2e8fb10a987422a2b26037c876cdb9d63ac6c515ad0d611e602ff1b2d57861e87fcf27382f253f4e5
@@ -7,7 +7,8 @@ module Codebreaker
7
7
  :attempts_ttl,
8
8
  :attempts_used,
9
9
  :hints_ttl,
10
- :hints_used
10
+ :hints_used,
11
+ :date
11
12
  )
12
13
 
13
14
  def initialize(name, difficulty, game)
@@ -18,6 +19,7 @@ module Codebreaker
18
19
  @hints_ttl = hints_ttl
19
20
  @hints_used = nil
20
21
  @rating = nil
22
+ @date = nil
21
23
  end
22
24
 
23
25
  def <=>(other)
@@ -5,9 +5,10 @@ module Codebreaker
5
5
 
6
6
  class << self
7
7
  def write(player)
8
- @data.push(player)
8
+ data = load
9
+ data.push(player)
9
10
 
10
- sorted = @data.sort
11
+ sorted = data.sort
11
12
 
12
13
  if sorted.length >= 1
13
14
  (0..(sorted.length - 1)).each do |i|
@@ -17,7 +18,7 @@ module Codebreaker
17
18
  sorted[0].rating = 1
18
19
  end
19
20
 
20
- File.write(@path, sorted.to_yaml)
21
+ File.write(STORE, sorted.to_yaml)
21
22
  end
22
23
 
23
24
  def load
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codebraker_ov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleh Volynets