Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chusaku

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chusaku

  • 1.4.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Chusaku

Gem Version

Add comments above your Rails actions that look like:

# @route GET /waterlilies/:id (waterlily)
def show
  # ...
end

# @route PATCH /waterlilies/:id (waterlily)
# @route PUT /waterlilies/:id (waterlily)
def update
  # ...
end

Based on your routes.rb file!

Installation

Add this line to your Rails application's Gemfile:

group :development do
  gem "chusaku", require: false
end

And then execute:

bundle install

Usage

From the root of your Rails application, run:

bundle exec chusaku

Chusaku has some flags available for use as well:

$ bundle exec chusaku --help
Usage: chusaku [options]
        --dry-run                       Run without file modifications
        --exit-with-error-on-annotation Fail if any file was annotated
    -c, --controllers-pattern=GLOB      Specify alternative controller files glob pattern
    -e, --exclusion-pattern=GLOB        Specify controller files exclusion glob pattern
        --verbose                       Print all annotated files
    -v, --version                       Show Chusaku version number and quit
    -h, --help                          Show this help message and quit

Rake usage

If you'd like to use Chusaku as a Rake task, add the following line to your Rakefile:

require "chusaku"
Chusaku.load_tasks

This will then allow you to call:

bin/rake chusaku

To pass flags, pass them like you would from the CLI executable:

bin/rake chusaku -- --dry-run --exit-with-error-on-annotation

Development

Read the blog post explaining how the gem works at a high level: https://nshki.com/chusaku-a-controller-annotation-gem.

After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, git commits and tags, and push the .gem file to rubygems.org.

FAQs

Package last updated on 10 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc