Sha256: df992a7f52d7548db50f0905d4f0d2f89aec204696a5f3adabff42af4bccc510

Contents?: true

Size: 689 Bytes

Versions: 5

Compression:

Stored size: 689 Bytes

Contents

Dir.chdir(File.dirname(__FILE__)) do
  require './environment'
  require './yodel'
end

class YodelConfig
  def initialize
    @options = {
      'yodel_migration_directory' => File.join(File.dirname(__FILE__), '..', 'models', 'migrations'),
      'public_directories' => [File.join(File.dirname(__FILE__), '..', 'public')],
      'layout_directories' => [],
      'extensions' => []
    }
  end
  
  def method_missing(method, *args)
    method = method.to_s
    if method[-1] == '='
      @options[method[0...-1]] = args[0]
    elsif method[-1] == '?'
      @options.has_key?(method[0...-1])
    else
      @options[method]
    end
  end
  
  def define(&block)
    yield self
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yodel-0.0.7 lib/yodel/config/config.rb
yodel-0.0.4 lib/yodel/config/config.rb
yodel-0.0.3 lib/yodel/config/config.rb
yodel-0.0.2 lib/yodel/config/config.rb
yodel-0.0.1 lib/yodel/config/config.rb