class Aaron::Aaron

Attributes

config[R]
file[R]

Public Class Methods

from_file(file) click to toggle source
# File lib/aaron.rb, line 39
def self.from_file file
  Aaron.new(File.read(file), file)
end
locate_config_file() click to toggle source
# File lib/aaron.rb, line 22
def self.locate_config_file
  @@possible_config_file_locations.find { |p| File.exists?(p) }
end
new(config, file = nil) click to toggle source
# File lib/aaron.rb, line 43
def initialize config, file = nil
  @config = config
  @file   = file
end
run() click to toggle source
# File lib/aaron.rb, line 26
def self.run
  config_file = Aaron.locate_config_file
  if config_file
    Aaron.from_file(config_file).run
  else
    raise Errors::ConfigFileNotFound.new %Q(
      Aaron was unable to locate his config file.
      He looked in
      #{@@possible_config_file_locations.join("\n")}
    )
  end
end

Public Instance Methods

get_binding() click to toggle source
# File lib/aaron.rb, line 48
def get_binding
  DSL.new.instance_eval { binding }
end
run() click to toggle source
# File lib/aaron.rb, line 52
def run
  eval(config, get_binding, file).run
end