Skip to content

QNester/methodist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Methodist

Build Status Maintainability Gitter

Methodist - a gem for Ruby on Rails created to stop chaos in your buisness logic. This gem adds generators to your rails application using some patterns:

  • Interactor: a class for doing some complex job step by step.
  • Observer: notifies one part of an application about changes in another part of an application.
  • Builder: is used to create an object with complex configuration (including your business logic, validation etc.)
  • Client: a class with implements methods for external services (databases, APIs and etc). For example, class called TelegramApiClient will implements methods for HTTP requests to telegram API.
  • Service: a class which encapsulates some business logic in semantic module. For example, class called NotificationService - implement methods for notifications. Or CacheService - implement methods for caching.

Installation

Add this line to your application's Gemfile:

gem 'methodist'

And then execute:

$ bundle

Or install it yourself:

$ gem install methodist

Usage

Just execute in a terminal

rails g <pattern_name> <generated_class>

where <pattern_name> is one of the patterns (observer, interactor, etc.)

About every Methodist pattern you can read here

Contributing

To contribute just:

  1. Create issue. Issue should contain information about goals of your future changes.
  2. Fork project.
  3. Create branch. The name of the branch should begin with the ID of your issue. Examle: ISSUE-205-create-new-pattern-generator.
  4. Make changes.
  5. Write tests.
  6. Make a commit. The name of the commit should begin with the ID of your issue. Examle: [ISSUE-205] Create new pattern generator.
  7. Push.
  8. Create a pull request to the develop branch.

License

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