Module: DaemonKit

Defined in:
lib/daemon_kit.rb,
lib/daemon_kit/em.rb,
lib/daemon_kit/amqp.rb,
lib/daemon_kit/cron.rb,
lib/daemon_kit/xmpp.rb,
lib/daemon_kit/config.rb,
lib/daemon_kit/jabber.rb,
lib/daemon_kit/nanite.rb,
lib/daemon_kit/safety.rb,
lib/daemon_kit/pid_file.rb,
lib/daemon_kit/arguments.rb,
lib/daemon_kit/exceptions.rb,
lib/daemon_kit/generators.rb,
lib/daemon_kit/application.rb,
lib/daemon_kit/initializer.rb,
lib/daemon_kit/nanite/agent.rb,
lib/daemon_kit/cucumber/world.rb,
lib/daemon_kit/ruote_workitem.rb,
lib/daemon_kit/abstract_logger.rb,
lib/daemon_kit/generators/base.rb,
lib/daemon_kit/ruote_participants.rb,
lib/daemon_kit/error_handlers/base.rb,
lib/daemon_kit/core_ext/configurable.rb,
lib/daemon_kit/error_handlers/hoptoad.rb,
lib/daemon_kit/ruote_pseudo_participant.rb,
lib/generators/daemon_kit/app/app_generator.rb,
lib/generators/daemon_kit/amqp/amqp_generator.rb,
lib/generators/daemon_kit/cron/cron_generator.rb,
lib/generators/daemon_kit/xmpp/xmpp_generator.rb,
lib/generators/daemon_kit/rspec/rspec_generator.rb,
lib/generators/daemon_kit/ruote/ruote_generator.rb,
lib/generators/daemon_kit/app/templates/config/boot.rb,
lib/generators/daemon_kit/cucumber/cucumber_generator.rb,
lib/generators/daemon_kit/test_unit/test_unit_generator.rb,
lib/generators/daemon_kit/capistrano/capistrano_generator.rb,
lib/generators/daemon_kit/nanite_agent/nanite_agent_generator.rb

Defined Under Namespace

Modules: Configurable, Cucumber, ErrorHandlers, Generators, Nanite Classes: AMQP, AbstractLogger, Application, Arguments, Boot, Config, Configuration, Cron, DaemonNotFound, EM, Exception, GemBoot, Initializer, Jabber, MissingParticipant, PidFile, RuoteParticipants, RuotePseudoParticipant, RuoteWorkitem, Safety, VendorBoot, XMPP

Constant Summary collapse

VERSION =
'0.1.8.31'

Class Method Summary collapse

Class Method Details

.argumentsObject



28
29
30
# File 'lib/daemon_kit/initializer.rb', line 28

def arguments
  @arguments
end

.arguments=(args) ⇒ Object



32
33
34
# File 'lib/daemon_kit/initializer.rb', line 32

def arguments=( args )
  @arguments = args
end

.at_shutdown(&block) ⇒ Object



40
41
42
# File 'lib/daemon_kit/initializer.rb', line 40

def at_shutdown( &block )
  self.configuration.at_shutdown( &block )
end

.boot!Object



17
18
19
20
21
# File 'lib/generators/daemon_kit/app/templates/config/boot.rb', line 17

def boot!
  unless booted?
    pick_boot.run
  end
end

.booted?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/generators/daemon_kit/app/templates/config/boot.rb', line 23

def booted?
  defined? DaemonKit::Initializer
end

.configurationObject



20
21
22
# File 'lib/daemon_kit/initializer.rb', line 20

def configuration
  @configuration
end

.configuration=(configuration) ⇒ Object



24
25
26
# File 'lib/daemon_kit/initializer.rb', line 24

def configuration=( configuration )
  @configuration = configuration
end

.envObject



51
52
53
# File 'lib/daemon_kit.rb', line 51

def env
  DAEMON_ENV
end

.framework_rootObject



55
56
57
# File 'lib/daemon_kit.rb', line 55

def framework_root
  @framework_root ||= File.join( File.dirname(__FILE__), '..' ).to_absolute_path
end

.loggerObject



39
40
41
# File 'lib/daemon_kit.rb', line 39

def logger
  @logger
end

.logger=(logger) ⇒ Object



43
44
45
# File 'lib/daemon_kit.rb', line 43

def logger=( logger )
  @logger = logger
end

.pick_bootObject



27
28
29
# File 'lib/generators/daemon_kit/app/templates/config/boot.rb', line 27

def pick_boot
  (vendor_kit? ? VendorBoot : GemBoot).new
end

.rootObject



47
48
49
# File 'lib/daemon_kit.rb', line 47

def root
  DAEMON_ROOT
end

.trap(*args, &block) ⇒ Object



36
37
38
# File 'lib/daemon_kit/initializer.rb', line 36

def trap( *args, &block )
  self.configuration.trap( *args, &block )
end

.vendor_kit?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/generators/daemon_kit/app/templates/config/boot.rb', line 31

def vendor_kit?
  File.exists?( "#{DAEMON_ROOT}/vendor/daemon-kit" )
end