Class: Hieracles::Farm
- Inherits:
-
Object
- Object
- Hieracles::Farm
- Defined in:
- lib/hieracles/farm.rb
Instance Method Summary collapse
-
#initialize(name, config) ⇒ Farm
constructor
A new instance of Farm.
- #modules ⇒ Object
- #nodes ⇒ Object
Constructor Details
#initialize(name, config) ⇒ Farm
4 5 6 7 |
# File 'lib/hieracles/farm.rb', line 4 def initialize(name, config) @name = name @config = config end |
Instance Method Details
#modules ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/hieracles/farm.rb', line 12 def modules() regex = Regexp.new('\s*include\s*([-_a-z0-9]*)') extract_path = Regexp.new(".*#{@config.classpath.sub(/%s/,'([^/]*)')}") Dir.glob(format(@config.classpath, '*')).sort.reduce({}) do |a, f| name = f.sub(extract_path, "\\1") a[name] = find_item(f, regex) a end end |
#nodes ⇒ Object
9 10 |
# File 'lib/hieracles/farm.rb', line 9 def nodes() end |