Pattern Bibz logo

Pattern Bibz

Rails Ruby Pattern Generator. This gem allows to generate your design pattern through the rails generator.

Gem Version Maintainability Test Coverage security Ci Linter Inline docs Ruby Style Guide

Usage

rails generate pattern PATTERN_NAME

Example

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:

gem 'pattern_bibz', group: :development

And then execute:

$ bundle

Or install it yourself as:

$ gem install pattern_bibz

Utils

To extend your Rails model generator:

$ rails g pattern_bibz:extend_model

Then you can generate your model:

$ rails g model MyModel title:string ...

Your generated model will look like this:

# 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.