https://github.com/thooams/pattern_bibz
Rails Pattern Generator
https://github.com/thooams/pattern_bibz
design-pattern pattern rails ruby ruby-on-rails
Last synced: 5 months ago
JSON representation
Rails Pattern Generator
- Host: GitHub
- URL: https://github.com/thooams/pattern_bibz
- Owner: thooams
- License: mit
- Created: 2020-03-21T07:56:37.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-01-19T18:00:17.000Z (over 3 years ago)
- Last Synced: 2025-12-04T16:36:32.164Z (7 months ago)
- Topics: design-pattern, pattern, rails, ruby, ruby-on-rails
- Language: Ruby
- Homepage:
- Size: 77.1 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: MIT-LICENSE
Awesome Lists containing this project
README

# Pattern Bibz
Rails Ruby Pattern Generator.
This gem allows to generate your design pattern through the rails generator.
[](https://badge.fury.io/rb/pattern_bibz)
[](https://codeclimate.com/github/thooams/pattern_bibz/maintainability)
[](https://codeclimate.com/github/thooams/pattern_bibz/test_coverage)
[](https://hakiri.io/github/thooams/pattern_bibz/main)
[](https://github.com/thooams/pattern_bibz/actions)
[](https://github.com/thooams/pattern_bibz/actions)
[](http://inch-ci.org/github/thooams/pattern_bibz)
[](https://github.com/rubocop-hq/rubocop)
## Usage
```bash
rails generate pattern PATTERN_NAME
```
## Example
```bash
rails generate pattern MyCustomDecorator
```
Files generated:
app/decorators/application_decorator.rb
app/decorators/my_custom_decorator.rb
test/decorators/application_decoratior_test.rb
test/decorators/my_custom_decorator_test.rb
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'pattern_bibz', group: :development
```
And then execute:
```bash
$ bundle
```
Or install it yourself as:
```bash
$ gem install pattern_bibz
```
## Utils
To extend your Rails model generator:
```bash
$ rails g pattern_bibz:extend_model
```
Then you can generate your model:
```bash
$ rails g model MyModel title:string ...
```
Your generated model will look like this:
```ruby
# frozen_string_literal: true
class MyModel < ApplicationRecord
# Scopes
# Constants
# Callbacks
# Attr_accessors
# Associations
# Enums
# Validations
# Delegations
# Methods
end
```
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).