https://github.com/alexwayfer/flame
Ruby web-framework
https://github.com/alexwayfer/flame
backend framework ruby web web-framework
Last synced: about 2 months ago
JSON representation
Ruby web-framework
- Host: GitHub
- URL: https://github.com/alexwayfer/flame
- Owner: AlexWayfer
- License: mit
- Created: 2016-02-04T18:09:08.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2025-04-04T12:46:00.000Z (about 2 months ago)
- Last Synced: 2025-04-04T13:12:33.312Z (about 2 months ago)
- Topics: backend, framework, ruby, web, web-framework
- Language: Ruby
- Homepage:
- Size: 823 KB
- Stars: 49
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
![]()
Flame
Flame is a small Ruby web framework, built on [Rack](https://github.com/rack/rack),
inspired by [Gin](https://github.com/jcasts/gin) (which follows class-controllers style),
designed as a replacement [Sinatra](https://github.com/sinatra/sinatra)
or maybe even [Rails](https://github.com/rails/rails).## Why?
I didn'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 as it can be.## Installation
Using the built-in `gem`:
```bash
$ gem install flame
```or with [Bundler](http://bundler.io/):
```ruby
# Gemfile
gem 'flame'
```## Usage
The simplest example:
```ruby
# index_controller.rbclass IndexController < Flame::Controller
def index
view :index # or just `view`, Symbol as method-name by default
enddef hello_world
"Hello World!"
enddef goodbye
"Goodbye World!"
end
end# app.rb
class App < Flame::Application
mount IndexController do
# all methods will be mounted automatically, it's just an example of refinement
get '/hello', :hello_world
end
end# config.ru
require_relative './index_controller'
require_relative './app'
run App.new # or `run App`
```More at [Wiki](https://github.com/AlexWayfer/flame/wiki).
## Benchmark
The last benchmark can be viewed [here](https://github.com/luislavena/bench-micro).
## Development
After checking out the repo, run `bundle install` to install dependencies.
Then, run `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](https://github.com/AlexWayfer/gem_toys#release).## Contributing
Bug reports and pull requests are welcome on [GitHub](https://github.com/AlexWayfer/flame).
## License
The gem is available as open source under the terms of the
[MIT License](https://opensource.org/licenses/MIT).