Class: DataDepo::YAMLLoader
- Inherits:
-
Loader
- Object
- Loader
- DataDepo::YAMLLoader
show all
- Defined in:
- lib/data_depo/yaml_loader.rb
Instance Attribute Summary
Attributes inherited from Loader
#paths
Instance Method Summary
collapse
Methods inherited from Loader
#initialize
Instance Method Details
#files ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/data_depo/yaml_loader.rb', line 13
def files
@paths.each.inject([]) do |a, path|
Dir.glob(File.join(path, '**', '*.yml')) {|file|
a << file
} if File.directory?(path)
filename = path + '.yml'
a << filename if File.file?(filename)
a
end
end
|
#load ⇒ Object
7
8
9
10
11
|
# File 'lib/data_depo/yaml_loader.rb', line 7
def load
files.each.inject([]) {|a, file|
load_file_into_array(file, a); a
}
end
|