Sha256: f2326e103188a258d8c10f4314905a9a1938f6b29bfe5dfb0546b9e2bde87972

Contents?: true

Size: 905 Bytes

Versions: 5

Compression:

Stored size: 905 Bytes

Contents

module Empezar
  class Runner
    def self.run argument = 'config/main.yaml'
      self.start_configuration argument
      self.start_logger
    end

    def self.start_configuration argument
      unless File.exist? argument
        raise ConfigurationFileMissingException, "The configuration file is missing from '#{argument}'"
      end
      Empezar::Configuration.instance.merge! SymbolMatrix.new argument
    end

    def self.start_logger
      Dir.mkdir 'log' unless Dir.exist? 'log'
      Empezar::Log.start Logger.new 'log/main.log', 'daily'
      if Empezar::Configuration.instance.has_key? :verbosity and Empezar::Configuration.instance.verbosity == 'silent'
      else
        Empezar::Log.instance.formatter = EchoingFormatter.new Logger::Formatter.new
      end
    end
  end
end

class Runner
  class << self
    def method_missing *args
      Empezar::Runner.send *args
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
empezar-0.2.0 lib/empezar/runner.rb
empezar-0.1.3 lib/empezar/runner.rb
empezar-0.1.2 lib/empezar/runner.rb
empezar-0.1.1 lib/empezar/runner.rb
empezar-0.1.0 lib/empezar/runner.rb