Closed nshki closed 5 years ago
This PR introduces two new service objects.
This module consumes the routes info available through Rails and spits out a consumable version of it.
Rails
Example output:
{ 'users' => { 'edit' => { verb: 'GET', path: '/users/:id', name: 'edit_user' }, 'update' => { verb: 'PUT', path: '/users', name: nil } }, 'empanadas' => { 'create' => { verb: 'POST', path: '/empanadas', name: nil } } }
This module parses a file and groups its lines into categories.
Example input:
class Foo # Bar # Baz def action_name; end end # vanilla is the best flavor
[ { type: :code, body: 'class Foo\n', action: nil }, { type: :comment, body: ' # Bar\n # Baz\n', action: nil }, { type: :action, body: ' def action_name; end\n', action: 'action_name' } { type: :code, body: 'end # vanilla is the best flavor\n', action: nil } ]
I wanted to account for a few different scenarios:
@route
bundle exec chusaku
This PR should fix these scenarios.
This PR introduces two new service objects.
Chusaku::Routes
This module consumes the routes info available through
Rails
and spits out a consumable version of it.Example output:
Chusaku::Parser
This module parses a file and groups its lines into categories.
Example input:
Example output:
Edge Cases
I wanted to account for a few different scenarios:
@route
comments (e.g. re-runningbundle exec chusaku
).@route
comments that should be deleted because of updated routes.@route
comments.This PR should fix these scenarios.