lib/vidar/config.rb in vidar-0.13.0 vs lib/vidar/config.rb in vidar-0.13.1
- old
+ new
@@ -18,15 +18,21 @@
class << self
attr_reader :data
attr_writer :manifest_file
def load(file_path = manifest_file)
+ ensure_file_exist!(file_path)
+
@data = YAML.load_file(file_path)
@loaded = true
end
def manifest_file
@manifest_file || DEFAULT_MANIFEST_FILE
+ end
+
+ def ensure_file_exist!(file_path)
+ fail(MissingManifestFileError, file_path) unless File.exist?(file_path)
end
def loaded?
@loaded
end