imageaid/rails_service_generator

View on GitHub
lib/generators/rails_services/USAGE

Summary

Maintainability
Test Coverage
Description:
    Creates a service class and accompanying spec/test unit file
    Destroys a service class and accompanying spec/test unit file
    Creates a form object and accompanying spec/test unit file

Service Example:
    rails generate rails_services:create Thing Model|Controller -- sub_folder Sub-folder [opt]]

    This will add:
        app/services/model|controller/[sub-folder]/thing.rb
        # either
        spec/services/model|controller/[sub-folder]/thing_spec.rb
        # or
        test/services/model|controller/[sub-folder]/thing_test.rb

    rails generate rails_services:destroy Thing Model|Controller -- sub_folder Sub-folder [opt]]

    This will remove:
        app/services/model|controller/[sub-folder]/thing.rb
        # either
        spec/services/model|controller/[sub-folder]/thing_spec.rb
        # or
        test/services/model|controller/[sub-folder]/thing_test.rb

Form Example:
    rails generate rails_services:form Thing Model|Controller -- sub_folder Sub-folder [opt] --accessors name email [opt]

    This will add:
        app/forms/[parent-folder]/[sub-folder]/thing_form.rb
        # either
        spec/forms/[parent-folder]/[sub-folder]/thing_form_spec.rb
        # or
        test/forms/[parent-folder]/[sub-folder]/thing_form_test.rb