Class: Animal::Plugins::Storage::Yaml

Inherits:
StoragePlugin show all
Defined in:
lib/animal/plugins/storage/yaml.rb

Overview

The basic, YAML storage plugin

Class Method Summary collapse

Methods inherited from StoragePlugin

get

Class Method Details

.all(type) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/animal/plugins/storage/yaml.rb', line 6

def self.all(type)
  # TODO: add caching in here...
  results = []
  Dir.chdir File.expand_path(File.join(ANIMAL_HOME, "#{type}.d")) do
    Dir.glob('*.yml').each do |file|
      results.concat ::YAML.load_file(file)
    end
  end
  results
end