Laminar on Rails
Adds Rails support to the Laminar workflow gem. Laminar Rails supports Ruby MRI versions 2.3+ and rails 4.2 - 6.0.
Installation
Add this line to your application's Gemfile:
gem 'laminar-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install laminar-rails
Usage
Laminar-Rails adds a couple of generators to facilitate the creation of new Laminar particles and flows.
$ rails generate laminar:particle foo
The generator adds a file app/flows/foo.rb
:
class Foo
include Laminar::Particle
def call
# TODO
end
end
The generator also adds a matching spec/flows/foo_spec.rb
.
There is also a flow generator:
$ rails generate laminar:flow foo
that creates a flow template:
class Foo
include Laminar::Flow
# flow do
# step :step1
# step :step2
# end
end
You can specify particle names on the generator command line.
$ rails generate laminar:flow foo something something_else
will create a new flow pre-populated with steps:
class Foo
include Laminar::Flow
flow do
step :something
step :something_else
end
end
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/laminar-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Laminar::Rails project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.