Sha256: 404c51777ed17d0b96957ca1d2f7bf998c07f2d592035f715b2a8038f2251a8c

Contents?: true

Size: 719 Bytes

Versions: 3

Compression:

Stored size: 719 Bytes

Contents

require 'rack'

# Happy is currently making use of ActiveSupport. I'm not 100% happy
# about this dependency and will eventually try to remove it.
# The following line should at least make sure that the individual
# components are autoloaded as needed.
require 'active_support'

require 'happy/version'
require 'happy/errors'
require 'happy/helpers'
require 'happy/controller'

module Happy
  def self.env
    ActiveSupport::StringInquirer.new(ENV['RACK_ENV'] || 'development')
  end

  # Creates a new Happy::Controller class, using the provided block as
  # its routing block.
  #
  def self.route(&blk)
    Class.new(Happy::Controller).tap do |klass|
      klass.send(:define_method, :route, &blk)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
happy-0.1.0 lib/happy.rb
happy-0.1.0.pre28 lib/happy.rb
happy-0.1.0.pre27 lib/happy.rb