I don't like class methods, especially for controller's hooks — OOP is prettier without it. And I found a way to implement controller's hooks without using class methods, but with the inheritance (including the including of modules). Moreover, with class methods an insufficiently obvious order of hooks (especially with inheritance) and complicated implementation of conditions are obtained. In this framework everything is Ruby-native.
Using the built-in
$ gem install flame
or with Bundler:
# Gemfile gem 'flame'
The simplest example:
# index_controller.rb class IndexController < :: def index view :index # or just `view`, Symbol as method-name by default end def hello_world "Hello World!" end def goodbye "Goodbye World!" end end # app.rb class App < :: mount :index do get '/hello', :hello_world end end # config.ru require_relative './index_controller' require_relative './app' run App.new # or `run App`
More at Wiki.
The last benchmark can be viewed here.
After checking out the repo, run
bundle install to install dependencies.
toys rspec to run the tests.
To install this gem onto your local machine, run
toys gem install.
To release a new version, run
toys gem release %version%.
See how it works here.
Bug reports and pull requests are welcome on GitHub.
The gem is available as open source under the terms of the MIT License.