Methodist
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:
- Create issue. Issue should contain information about goals of your future changes.
- Fork project.
- Create branch. The name of the branch should begin with the ID of your issue.
Examle:
ISSUE-205-create-new-pattern-generator
. - Make changes.
- Write tests.
- Make a commit. The name of the commit should begin with the ID of your issue.
Examle:
[ISSUE-205] Create new pattern generator
. - Push.
- Create a pull request to the
develop
branch.
License
The gem is available as open source under the terms of the MIT License.