Class: Ploy::MetaSrc
- Inherits:
-
Object
- Object
- Ploy::MetaSrc
- Defined in:
- lib/ploy/metasrc.rb
Instance Method Summary collapse
-
#initialize(dir) ⇒ MetaSrc
constructor
A new instance of MetaSrc.
- #load ⇒ Object
Constructor Details
#initialize(dir) ⇒ MetaSrc
Returns a new instance of MetaSrc.
3 4 5 |
# File 'lib/ploy/metasrc.rb', line 3 def initialize(dir) @dir = dir end |
Instance Method Details
#load ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ploy/metasrc.rb', line 6 def load d = {} return {} unless Dir.exists? @dir Dir.foreach(@dir) do |fname| if (fname =~ /\.ya?ml$/) then y = YAML::load_file(File.join(@dir,fname)) d[y['name']] = y end end return d end |