cog-rb 0.1.10 → 0.1.11

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
  SHA1:
3
- metadata.gz: c483003f31da134986c41e6df9652376d87c6122
4
- data.tar.gz: 0b2b8f28dc88324a64e17a2f58cb78581d8d8122
3
+ metadata.gz: d075ef035a49147b6624dcfdcb9742ea1280dd81
4
+ data.tar.gz: 7c2a8373eeff100276c7dbfd2f0440672b70ef39
5
5
  SHA512:
6
- metadata.gz: b0dbb6591fbaaf73e42a5819d17141c25495781070628dd86aa83a9f61d34f20927b9485e8efcfc8a8a3f2eb425b2749ab9e876bfb8c9d5cc1185bc360cfbe10
7
- data.tar.gz: 41a471f281608c8075565f212f76988fcca892647201950ff2b25a8b436aec8a1aaee71310637caf209e82440af3713d8d1f928da7311d4605ea304d52ad7cb0
6
+ metadata.gz: 7d622a0bbf4f226828dc9b63002f30047b56f058c2eaa5f5fb3a65415411621d1f049444c8146637b486d6c5cde0eb31581f57a5983fd6987b039838afd8a078
7
+ data.tar.gz: 24e451eca4a10d8d8ad5e8e6a8ec548683cfd476030b3d11e181516b1f34a99d2bbdb46073af656e16d51f0818e624687094467bf8c9771f998773a296fb1015
data/lib/cog/config.rb CHANGED
@@ -3,12 +3,12 @@ require "yaml"
3
3
 
4
4
  class Cog
5
5
  class Config
6
- attr_reader :config_file, :data, :stale
6
+ attr_reader :config_file, :yaml, :data
7
7
 
8
8
  def initialize(config_file)
9
9
  @config_file = config_file
10
- @data = YAML.load(File.read(@config_file))
11
- @stale = false
10
+ @yaml = File.read(@config_file)
11
+ @data = YAML.load(@yaml)
12
12
  end
13
13
 
14
14
  def dump
@@ -21,7 +21,6 @@ class Cog
21
21
 
22
22
  def []=(key, value)
23
23
  @data[key.to_s] = value
24
- @stale = true
25
24
  end
26
25
 
27
26
  def update_version(version = nil)
@@ -32,20 +31,21 @@ class Cog
32
31
  segments[-1] = segments.last.to_i + 1
33
32
  @data['version'] = segments.join('.')
34
33
  end
34
+
35
+ @data['version']
35
36
  end
36
37
 
37
38
  def save
38
- return unless @stale
39
+ return unless self.stale?
39
40
 
40
41
  contents = YAML.dump(@data)
41
42
  File.open(@config_file, 'w') do |out|
42
43
  out.write(contents)
43
- @stale = false
44
44
  end
45
45
  end
46
46
 
47
47
  def stale?
48
- @stale
48
+ @yaml != YAML.dump(@data)
49
49
  end
50
50
  end
51
51
  end
data/lib/cog/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Cog
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cog-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Imbriaco