Module: Happy

Defined in:
lib/happy.rb,
lib/happy/errors.rb,
lib/happy/request.rb,
lib/happy/helpers.rb,
lib/happy/version.rb,
lib/happy/response.rb,
lib/happy/controller.rb,
lib/happy/helpers/i18n.rb,
lib/happy/helpers/html.rb,
lib/happy/extras/static.rb,
lib/happy/helpers/rendering.rb,
lib/happy/extras/scriptable.rb,
lib/happy/controller/actions.rb,
lib/happy/controller/routing.rb,
lib/happy/controller/rackable.rb,
lib/happy/extras/code_reloader.rb,
lib/happy/controller/permissions.rb,
lib/happy/controller/configurable.rb,
lib/happy/extras/action_controller.rb,
lib/happy/request/date_parameter_converter.rb

Defined Under Namespace

Modules: Errors, Extras, Helpers Classes: Controller, Request, Response

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.envObject


13
14
15
# File 'lib/happy.rb', line 13

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

.route(&blk) ⇒ Object

Creates a new Happy::Controller class, using the provided block as its routing block.


20
21
22
23
24
# File 'lib/happy.rb', line 20

def self.route(&blk)
  Class.new(Happy::Controller).tap do |klass|
    klass.send(:define_method, :route, &blk)
  end
end