Project

shorui

0.0
The project is in a healthy, maintained state
A gem that helps you generate README.md from routes.rb
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 7.0
>= 0
 Project Readme

alt text

Gem Version

Shorui is a Ruby gem that automatically generates API documentation by analyzing your Rails routes. It creates a clean, organized README.md file with detailed endpoint information.

Installation

Add this line to your application's Gemfile:

gem 'shorui'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install shorui

Usage

Shorui provides two Rake tasks:

  1. Generate full documentation including Rails routes:
rails shorui:generate
  1. Generate documentation excluding Rails routes:
rails shorui:generate:no_rails_routes

The gem will automatically:

  • Analyze your Rails routes
  • Extract controller and action information
  • Identify required and optional parameters
  • Generate a formatted README.md in your project root
  • Include HTTP verbs, paths, and parameter details

Output Format

The generated README.md will follow this structure:

# Your Project Name API Documentation

#### [HTTP_VERB] /path/to/endpoint
- **Controller#Action:** `controller_name#action_name`
- **Required Params:** `param1, param2` (if any)
- **Optional Params:** `param1, param2` (if any)

You can see a better example clicking here

Features

  • Automatic route analysis
  • Clean and consistent documentation format
  • Support for all HTTP verbs
  • Parameter identification (required and optional)
  • Rails route filtering option
  • Proper handling of namespaced routes
  • Automatic project name formatting

Development

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

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/thiagochirana/shorui. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Shorui project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Origins

"Shorui" (書類) means "document" in Japanese, reflecting the gem's purpose of automatic documentation generation.