Module: RuoteKit
- Defined in:
- lib/ruote-kit/version.rb,
lib/ruote-kit.rb,
lib/ruote-kit/application.rb,
lib/ruote-kit/helpers/json_helpers.rb,
lib/ruote-kit/helpers/link_helpers.rb,
lib/ruote-kit/helpers/misc_helpers.rb,
lib/ruote-kit/helpers/render_helpers.rb,
lib/ruote-kit/helpers/pagination_helpers.rb
Overview
license is MIT, see LICENSE.txt
Defined Under Namespace
Modules: Helpers Classes: Application
Constant Summary collapse
- VERSION =
'2.3.0.2'
Class Attribute Summary collapse
-
.engine ⇒ Object
(also: dashboard)
Returns the value of attribute engine.
Class Method Summary collapse
-
.bind_engine(storage) ⇒ Object
Uses the given storage for the RuoteKit.engine (no worker running here).
- .env ⇒ Object
-
.run_worker(storage, join = true) ⇒ Object
Given a storage, runs a worker and sets RuoteKit.engine accordingly.
-
.storage_participant ⇒ Object
(also: worklist)
Returns the storage participant associated automatically with any storage.
Class Attribute Details
.engine ⇒ Object Also known as: dashboard
Returns the value of attribute engine.
18 19 20 |
# File 'lib/ruote-kit.rb', line 18 def engine @engine end |
Class Method Details
.bind_engine(storage) ⇒ Object
Uses the given storage for the RuoteKit.engine (no worker running here).
52 53 54 |
# File 'lib/ruote-kit.rb', line 52 def bind_engine(storage) RuoteKit.engine = Ruote::Dashboard.new(storage) end |
.env ⇒ Object
24 25 26 |
# File 'lib/ruote-kit.rb', line 24 def env @env ||= defined?(Rails) ? Rails.env : ENV['RACK_ENV'] || 'development' end |
.run_worker(storage, join = true) ⇒ Object
Given a storage, runs a worker and sets RuoteKit.engine accordingly.
By default, this method won’t return (it will ‘join’ the worker). If you need to go on after this call, pass false as second parameter (especially useful in an EventMachine setting).
45 46 47 48 |
# File 'lib/ruote-kit.rb', line 45 def run_worker(storage, join=true) RuoteKit.engine = Ruote::Dashboard.new(Ruote::Worker.new(storage)) RuoteKit.engine.join if join end |
.storage_participant ⇒ Object Also known as: worklist
Returns the storage participant associated automatically with any storage
30 31 32 |
# File 'lib/ruote-kit.rb', line 30 def storage_participant engine.storage_participant end |