lib/get_happy/engine.rb in get_happy-0.0.1 vs lib/get_happy/engine.rb in get_happy-1.0.0
- old
+ new
@@ -25,14 +25,14 @@
def get_collection
unless File.directory?(COLLECTION_DIR)
FileUtils.mkdir_p(COLLECTION_DIR)
end
- File.open(COLLECTION, "w+") do |file|
+ File.open(COLLECTION, "w") do |file|
file.write [].to_yaml
end unless File.file?(COLLECTION)
- YAML::load_file(COLLECTION) || []
+ YAML::load_file(COLLECTION)
end
end