Sha256: d561bfd865042d9975ac95dc82fafb3bafc52e074a9ef96e6f46a34374bde346

Contents?: true

Size: 987 Bytes

Versions: 2

Compression:

Stored size: 987 Bytes

Contents

require 'ostruct'
require 'forwardable'

require 'rack'

require 'coffee-script'
require 'haml'
require 'sass'

require 'uglifier'

require_relative 'rail/application'
require_relative 'rail/browser'
require_relative 'rail/context'
require_relative 'rail/pipeline'
require_relative 'rail/processor'
require_relative 'rail/request'
require_relative 'rail/server'
require_relative 'rail/support'
require_relative 'rail/version'

module Rail
  NotFoundError = Class.new(StandardError)

  def self.env
    @env ||= build_env
  end

  def self.applications
    ObjectSpace.each_object(Class).select do |klass|
      klass < Application
    end
  end

  private

  def self.build_env
    string = ENV['RAIL_ENV'] ? ENV['RAIL_ENV'].dup : 'development'

    string.singleton_class.class_eval do
      define_method(:method_missing) do |name, *arguments, &block|
        super unless name.to_s =~ /^(?<name>.+)\?$/
        self == Regexp.last_match(:name)
      end
    end

    string
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rail-0.0.7 lib/rail.rb
rail-0.0.6 lib/rail.rb