THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Ruby web-framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
depfu[bot] b7efb6f71b Update rubocop to version 0.80.0 5 days ago
example Upgrade RuboCop to version 0.78.0 (#111) 1 month ago
lib Improve `path_to` for Controllers with arguments in path 1 week ago
public Add 404 when not found and public-directory from library and fix default favicon 4 years ago
spec Improve `path_to` for Controllers with arguments in path 1 week ago
.cirrus.yml Add Ruby 2.7 for CI 1 week ago
.editorconfig Add EditoConfig rules for Markdown files 11 months ago
.gitignore Add `.ruby-version` file in `.gitignore` file 2 years ago
.rspec Switch from `minitest-bacon` to RSpec 1 year ago
.rubocop.yml Upgrade RuboCop to version 0.78.0 (#111) 1 month ago
CHANGELOG.md Allow to mount anonymous controllers 4 months ago
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2 years ago
CONTRIBUTING.md Add contribution guide 4 years ago
Gemfile Fix warnings for new RuboCop version 0.48 2 years ago
LICENSE Update copyright in license 3 years ago
README.md Fix badges in README 9 months ago
Rakefile Switch from `minitest-bacon` to RSpec 1 year ago
flame.gemspec Update rubocop to version 0.80.0 1 day ago

README.md

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.