From 099f8543f0aba22b61aa3adca55a07c171115aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Avelino?= Date: Tue, 31 Aug 2021 07:10:07 -0300 Subject: [PATCH] bump version 0.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: VĂ­tor Avelino --- CHANGELOG.md | 67 ++++++++++++++++++++++++----------- README.md | 2 +- lib/modular_routes/version.rb | 2 +- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 188682d..f9e0586 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ +## [v0.3.0] - 2021-08-30 + +**NEW** + +- `root` helper will raise a syntax error indicating that it should be used outside of `modular_routes` block. + +- `concern` and `concerns` support: + + ```ruby + modular_routes do + concern :commentable do + resource :comments + end + + concern :activatable do + member do + put :activate + put :deactivate + end + end + + resources :articles, concerns: :activatable do + concerns :commentable + end + end + ``` + ## [v0.2.0] - 2021-07-21 **REMOVED** @@ -9,11 +36,11 @@ - `modular_routes` helper was added to fix the problems encountered on the previous helper. Check the example below: ```ruby - modular_routes do - resources :books + modular_routes do + resources :books - get :about, to: "about#index" - end + get :about, to: "about#index" + end ``` The idea was to bring simplicity and proximity to what you already write in your routes file. @@ -21,9 +48,9 @@ - `namespace` support` ```ruby - namespace :v1 do - resources :books - end + namespace :v1 do + resources :books + end ``` It falls back to Rails default behavior. @@ -31,13 +58,13 @@ - `scope` support ```ruby - scope :v1 do - resources :books - end + scope :v1 do + resources :books + end - scope module: :v1 do - resources :books - end + scope module: :v1 do + resources :books + end ``` It falls back to Rails default behavior. In this example it recognizes `/v1/books` and `/books` expecting `BooksController` and `V1::BooksController` respectively. @@ -45,11 +72,11 @@ - Nested resources support ```ruby - modular_routes do - resources :books do - resources :comments - end + modular_routes do + resources :books do + resources :comments end + end ``` It recognizes paths like `/books/1/comments/2`. @@ -57,9 +84,9 @@ - Standalone (non-resourceful) routes ```ruby - modular_routes do - get :about, to: "about#index" - end + modular_routes do + get :about, to: "about#index" + end ``` It expects `About::IndexController` to exist in `controllers/about/index_controller.rb`. They don't belong to a resourceful scope. diff --git a/README.md b/README.md index 6131217..4c2ae63 100644 --- a/README.md +++ b/README.md @@ -410,7 +410,7 @@ resources :articles, concerns: [:activatable] # or -resources :articles do +resources :articles, concerns: :activatable do concerns :commentable end ``` diff --git a/lib/modular_routes/version.rb b/lib/modular_routes/version.rb index 7de3552..bbe780d 100644 --- a/lib/modular_routes/version.rb +++ b/lib/modular_routes/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ModularRoutes - VERSION = "0.2.0" + VERSION = "0.3.0" end