metastore 0.2.0 → 0.2.1

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: 9907f2335978385ce08d9d57db9c8d7e39235421
4
- data.tar.gz: 657b40f2a2b41dc58d69e2e54c6f928a25ee3ff3
3
+ metadata.gz: 49bf17ac306ec5daca0b23eb36ff66e870b982d6
4
+ data.tar.gz: 5c61a67a92cfafe34a831b0457d1623e696522e5
5
5
  SHA512:
6
- metadata.gz: fd1d3525002716dd313976d9bc60988dd0ee54b6edded5902aa9387db7c1c76bfa5a6d1a7c1ef1f05df1eb3d403e7467e51a18d9de85e246ebb57774a40ce6be
7
- data.tar.gz: 78d5c985e6f4dd2508cea585ac2e684009a02dd5e5f643aa7ab51c5337ac2502f7a4be732854da33e479fb30a5464b3d9bcb1e777311d87648a0239008ff667d
6
+ metadata.gz: 352a46c78ecb1e25a64b8c7c015ee2e9d61718decd431ae59cf2fd9bf3a254ff7252bc89a9e52bf9fe5510635d85f5c90ef8d7556f97a2f793d100d9209e1b34
7
+ data.tar.gz: c5d1ad73a624cd8b3387e2db01c521417343fc7e8c7465fa4ed88a2079489b3b7f0d1b1a480189be5cacbc9fca84094f6dd4e729917e10decd5829a477b14efa
data/lib/metastore.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'metastore/version'
2
+ require 'metastore/errors'
2
3
  require 'metastore/cabinet'
3
4
 
4
5
  module Metastore
@@ -17,6 +17,7 @@ module Metastore
17
17
  current_contents = contents
18
18
  set_key_and_value(current_contents, split_key(key), value)
19
19
  save!(current_contents)
20
+ true
20
21
  end
21
22
 
22
23
  def clear!
@@ -69,6 +70,8 @@ module Metastore
69
70
  def save!(new_values)
70
71
  FileUtils.mkdir_p(file.dirname) unless file.exist?
71
72
  File.open(file.to_s, 'w') { |f| f.write(new_values.to_yaml) }
73
+ rescue => e
74
+ raise Errors::CabinetCannotSet.new(e.message)
72
75
  end
73
76
 
74
77
  end
@@ -0,0 +1,5 @@
1
+ module Metastore
2
+ module Errors
3
+ class CabinetCannotSet < StandardError; end
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Metastore
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metastore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ash McKenzie
@@ -97,6 +97,7 @@ files:
97
97
  - Rakefile
98
98
  - lib/metastore.rb
99
99
  - lib/metastore/cabinet.rb
100
+ - lib/metastore/errors.rb
100
101
  - lib/metastore/version.rb
101
102
  - metastore.gemspec
102
103
  homepage: https://github.com/ashmckenzie/metastore