aritode / flame

Ruby web-framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flame Logo

Flame

Cirrus CI Codecov Code Climate Depfu Docs Gem MIT license

Flame is a small Ruby web framework, built on Rack, inspired by Gin (which follows class-controllers style), designed as a replacement Sinatra, or maybe even Rails.

Why?

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.

Installation

Using the built-in gem:

$ gem install flame

or with Bundler:

# Gemfile
gem 'flame'

Usage

The simplest example:

# index_controller.rb

class IndexController < Flame::Controller
  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 < Flame::Application
  mount :index do
    get '/hello', :hello_world
  end
end

# config.ru

require_relative './index_contoller'

require_relative './app'

run App.new # or `run App`

More at Wiki and in example/ directory.

Benchmark

The last benchmark can be viewed here.

About

Ruby web-framework

License:MIT License


Languages

Language:Ruby 98.9%Language:HTML 1.1%Language:CSS 0.0%