lib/metastore/cabinet.rb in metastore-0.2.0 vs lib/metastore/cabinet.rb in metastore-0.2.1
- old
+ new
@@ -15,10 +15,11 @@
def set(key, value)
current_contents = contents
set_key_and_value(current_contents, split_key(key), value)
save!(current_contents)
+ true
end
def clear!
save!({})
end
@@ -67,9 +68,11 @@
end
def save!(new_values)
FileUtils.mkdir_p(file.dirname) unless file.exist?
File.open(file.to_s, 'w') { |f| f.write(new_values.to_yaml) }
+ rescue => e
+ raise Errors::CabinetCannotSet.new(e.message)
end
end
end