Class: Conman

Inherits:
Object
  • Object
show all
Defined in:
lib/conman.rb

Class Method Summary collapse

Class Method Details

.init(options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/conman.rb', line 5

def self.init(options)
  ingredients_folder = options[:ingredients]
  
  puts "initializing with ingredients folder: #{ingredients_folder}"
  
  abort "You must specify an ingredient" if ingredients_folder.nil? or ingredients_folder.empty?
  
  ingredients = []
  
  Dir.glob(ingredients_folder + '*').each do |f|
    ingredients << "#{File.join f, File.basename(f)}.rb" if File.directory? f
    ingredients << f unless File.directory? f
  end
  
  #puts "Loading recipes: #{recipes.inspect}"
  puts "Loading #{ingredients.size} ingredient(s)"
  
  ingredients.each {|ingredient| load ingredient}
end

.run(options) ⇒ Object



25
26
27
28
# File 'lib/conman.rb', line 25

def self.run(options)
  script = options[:script]
  load script
end