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

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

Overview

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

Instance Method Summary collapse

Constructor Details

#initializeFormulaLoader

Returns a new instance of FormulaLoader.



14
15
16
# File 'lib/chemistrykit/cli/helpers/formula_loader.rb', line 14

def initialize
  @formulas = []
end

Instance Method Details

#get_formulas(path) ⇒ Object



18
19
20
21
# File 'lib/chemistrykit/cli/helpers/formula_loader.rb', line 18

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