Class: ChemistryKit::CLI::Helpers::FormulaLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/chemistrykit/cli/helpers/formula_loader.rb

Instance Method Summary collapse

Constructor Details

#initializeFormulaLoader

this loader returns the formulas found in a path according to these rules:

  • directories loaded in alpha order

  • children directories loaded before parents

  • files loaded in alpha order

  • lib directories are loaded before any other

  • rules stack



12
13
14
# File 'lib/chemistrykit/cli/helpers/formula_loader.rb', line 12

def initialize
  @formulas = Array.new
end

Instance Method Details

#get_formulas(path) ⇒ Object



16
17
18
19
# File 'lib/chemistrykit/cli/helpers/formula_loader.rb', line 16

def get_formulas(path)
  gather(path)
  @formulas
end