All notable changes to this project will be documented in this file.
- Add ability for controllers auto-mounting
Good bye giant applicationmount
blocks!
But you can disable it withnested: false
option formount
, for example, for conditional umbrella application. - Allow to mount anonymous controllers
- Add support for Ruby 3.0 – 3.4
- Add support of
OPTIONS
HTTP-method - Add
Application.require_dirs
method - Add
Controller#path_to_back
method - Add
:log_dir
for default config - Add
:require
option forConfig#load_yaml
- Receive options for Tilt in
Controller#(render|view)
method via:tilt
argument - Add support of block for
Controller#render
method - Add metadata to Gem specification with links
- Add required Ruby version into Gem specification
- Add
Controller.with_actions
method for modules Example:include with_actions ModuleWithActions
- Allow to render view by relative path from current view
- Add ability for refining HTTP-methods of actions inside controllers
Now you can not usepost
,patch
and others insidemount
blocks, yay! - Catch
SyntaxError
for custom Internal Server Error page - Add
:only
option to#with_actions
method - Add cache for
Controller#url_to
in production viamemery
gem - Add ability to refine actions in modules
Justextend Flame::Controller::Actions
in module now, and thaninclude with_actions ThatModule
, as before. - Add
Flame::Router::Routes#to_s
, for routes printingputs MyApplication.router.routes
- Add
Request#headers
method (with Camel-Cased Hash) - Accept options for cookies setting
- Add
Flame::Path#include?
method, forwarding to#to_s
- Allow integration with
better_errors
gem
More info here. - Add RuboCop plugins, resolve offenses by them
- Add
remark
Markdown linter
- Replace Array-based routes system with Hash-based
- Move
flame
executable andtemplate/
to separated gemflame-cli
, not required by default. - Take out
Config
fromFlame::Application
toFlame
Now it's possible to load config before routes (and models).
Also addConfigFileNotFoundError
. - Replace
URI
building withAddressable::URI
from external gem - Replace
no-cache
withpublic
andmax-age
(one year) forCache-Control
header for static files - Implemented 405 response instead of 404 for unavailable HTTP methods
- Change format of mounting from constants to Symbols
- Call
default_body
(for the nearest route) withoutexecute
- Switch from unsupported
bacon
tominitest-bacon
, and then to RSpec - Replace
Controller.with_actions
with.inherit_actions
- Move
Dispatcher#path_to
toApplication.path_to
- Replace
Controller#default_body
with#not_found
for 404 pages, like#server_error
for 500 pages. - Replace
URI.decode_www_form_component
withCGI.unescape
- Reduce the number of violations of the Law of Demeter
Thanks to @snuggs - Catch
invalid %-encoding
, halt 400 - Improve
#inspect
output for custom Errors - Switch from Travis CI to Cirrus CI
- Autoload
Render
module, don't eager require
I think it's unnecessary for API-like usage. - Slightly optimize
StaticFile
- Build query in
#path_to
from root-Hash
Now building a path with merged query parameters is easier, no moreparams: {}
. - Run
Controller#not_found
throughexecute
For found nearest routes.
Now we can write before-hooks inexecute
also for nonexistent pages. - Don't assign results of
execute
(after-hooks) asbody
- Require directories starting with
_
first - Allow to redefine controller path with
PATH
constant inside - Update Rack and GorillaPatch
- Update RuboCop to a new version, resolve new offenses
- Improve version locks for dependencies
- Use Depfu instead of closed Gemnasium
- Remove
Application#config
andApplication#router
methods - Remove Ruby < 2.7 support
- Remove HTML tags (
<h1>
) from default body
There is noContent-Type
HTTP header, also there is no reason to return exactly HTML content
(Flame can be used only for API or something else).
- Fix issue with
nil
in after-hook which returned 404 status - Fix routing to path without an optional argument at the beginning
- Fix routing for multiple routes starting with arguments
Example: parent controller withshow(id)
and nested controller at/:parent_id/nested
. - Avoid new controller creation in
halt
- Fix typos in documentation
- Fix exploit with static files
You could get the content of any file from the outside of public directory.
It did not work withnginx
, Cloudflare or something else.
- Add
RouteArgumentsOrderError
- Add
TemplateNotFoundError
when file for rendering not found - Add
CODE_OF_CONDUCT.md
- Add
:version
option forController#url_to
method with static files
- Remove ending slash from
Path#adapt
if initial path has all parameters - Rename
RouteArgumentsError
toRouteExtraArgumentsError
- Fix
RouteArgumentsValidator#action_arguments
caching - Fix gem requiring in some cases
- Add parent actions inheritance without forbidden actions
- Improve
Controller#extract_params_for
method
- Add support of Modules for
with_actions
method
- Return status from
Flame::Controller#redirect
- Fix body for rerouted action
- Add
Flame::Path#to_str
method for implicit conversion to String
- Add support of
Flame::Path
forController#url_to
- Add
Controller#reroute
method for executing another action
- Remove ending slash for
Path#adapt
to actions without parameters
- Fix default path for nested
IndexController
- Add
Path
class for more OOP
- Improve
Flame::Request#http_method
and comparing by it
- Add support of HTTP status as last argument for
Controller#redirect
method - Add support of
Controller#redirect
as argument forDispatcher#halt
- Return
nil
fromController#redirect
method
- Add support of
HEAD
HTTP method
- Return upcased symbolized HTTP method from
Flame::Request#http_method
- Add comparing by first argument including in path parts for Routes sorting
- Add support of
URI
objects forredirect
method
- Move cached views from
Flame::Render
toApplication
- Improve view files search by controller name
Don't remove extra (logical)controller
parts.
- Display default body for status (500) if controller has not initialized Don't raise another (the second) exception.
- Improve default body rendering
- Fix many errors in 4.12.0
- Add specs
- Add Travis CI integration
- Add Code Climate integration
- Update Ruby target version in RuboCop to 2.3
- Remove trailing slash for
path_to
without optional arguments - Replace two different errors about Route arguments
with oneRouteArgumentsError
- Require status for
halt
method before body - Move
Content-Type
writer from Dispatcher to Response - Try to find and return static files before routes
- Remove unnecessary Actions Validator
- Fix dependencies and their versions
- Fix issue with default body from Flame
- Fix issue with frozen path in
path_to
- Fix offenses from new RuboCop version
- Use
rack-slashenforce
instead of custom (built) implementation.
- Fix critical bug with static files
- Add
Cache-Control: no-cache
header for responses with static files
- Make methods for static files in Dispatcher private
- Fix
gemspec
require - Fix content type for attachments
- Fix views as symbolic links
- Add
halt
method for controllers
- Add support of actions optional arguments values
- Add more methods for Controller delegation from Dispatcher
- Replace
rescue
inexecute
withserver_error
private method
- Fix views files search
- Add redirect from request with many trailing slashes to path without them
- Add cache option for views render
- Fix layouts for
PlainTemplate
- Make
defaults
method for routes refines not required
- Add RuboCop as development dependency, resolve some offenses
- Update
gorilla-patch
to version2
- Add
Controller.actions
shortcut method
- Add
:tmp_dir
forApplication#config
- Add
PATCH
HTTP-method for routes refines
- Remove String keys from
params
, leave only Symbol
- Update
gorilla-patch
to version1.0.0
- Update gemspec syntax
- Add support of
:params
argument forpath_to
method
- Add support of
false
value for layout render option
- Improve parent actions inheritance
- Add method to inherit actions from superclass
- Add method to inherit actions from superclass
- Update
gorilla-patch
to fixed version
- Symbolize
params
keys nested in Arrays
- Update
rack
andtilt
dependencies
- Add port (after host) for
url_to
method
- Add port (after host) for
url_to
method
- Fix
default_body
for static files
- Fix bugs with
default_body
invoking
- Fix 404 (after previous change)
- Replace
not_found
method withdefault_body
and halting, for 404
- Fix nested layouts sorting
- Add
url_to
helper method for building full URL from controller
- Add support of views filenames as downcased controller name
when actions isindex
- Fix issue with cache of non-rendered
- Fix non-Symbol nested keys in request
params
- Add support of view render with multiple layouts
- Make
Flame::Render
work with cache
- Make
Flame::Render.tilts
public
- Add executable with
new
subcommand
- Add method for loading YAML files to Application
- Fix static files for Unicode filenames
- Improve views directories search (add more variants)
- Improve views directories search (more variants)
- Add
:index
action as default forpath_to
helper method
- Add
content_type
andattachment
helper methods for Dispatcher
- Take underscored preceding module name if controller is
IndexController
- Improve views directories search
- Remove
index
part from directories of views for controller
- Fix fatal issues from version 4.0.8
- Change Route class, fix many default-path-build errors
- Fix
ArgumentNotAssignedError
raising
- Fix dependencies
- Improve templates and layouts search
- Add support of protected
Controller#execute
methods
- Fix
GorillaPatch
usage - Fix error raising in
path_to
(for nonexistent route)
- Dump exception from Dispatcher if not dumped from Controller
- Improve default paths for controllers
- Add version file (and
Flame::VERSION
constant)
- Add internal helper method for plugins
- Relax
tilt
dependency - Return
nil
when template not found instead of 404
- Fix default REST actions
- Nest Validators, Errors and Route from root (
Flame
) namespace
- Make hooks as code in
Controller#execute
method (before and aftersuper
) - Documentation (YARD) added!
- Improve controllers templates folder searching
- Fix 404 error
- Make empty string as default body
- Add
body
(united reader and writer) method
- Add
Content-Type: text/html
header for default body
- Fix 404 without nearest route
- Add hooks for errors
- Fix and improve many things
- Remove middlewares and
Flame::Application.use
method
Userackup
for this.
- Make "all actions" as default for
after
andbefore
hooks
- Add Symbol keys in
params
alongside of String
- Make
:index
as default action forpath_to
- Fix error when body is
OK
instead of empty
- Add support of
RACK_ENV
environment variable - Add
:cache
option forrender
method (enabled by default)
- Fix templates
- Make default path for
IndexController
equal to/
- Add
helpers
method for applications
- Make Dispatcher as class, large refactoring
- Add
:config_dir
forApplication#config
- Fix error with
nil
action in routes refines
- Make path for routes refines not required
- Fix default paths of controllers
- Add (recursive)
mount
method for routes refine
- Improve template searching in different possible directories
- Make
path
argument ofFlame::Controller#view
method not required
- Fix
Flame::Controller#path_to
method
- Add (recursive)
mount
method for routes refine
- Make Controllers as classes, Dispatcher as helper module for Application
- Add
after
method (hook) for routes refine
- Add
Rack::Session::Pool
by default
- Add support for Rack middlewares in Flame applications
- Remove
Controller
class, make controllers as modules
- Set cookies for path
/
- Add more helper methods for
Flame::Dispatcher
and controllers
- Fix
scope
for layouts
- Improve version locks for other dependencies
- Improve version locks for dependencies
- Add REST actions as default
- Add
Flame::Request
(Rack::Request
wrapper) - Add
before
method for routes refine
- Fix Tilt-warnings
- Fix views search for controllers
- Add helper methods for controllers
- Fix bug when a view layout is missing
- Fix error with 'tilt' dependency