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

Class Method Summary collapse

Class Attribute Details

.engineObject 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

.envObject



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_participantObject 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