Sha256: 2ff937657dfbaf6d307b5c9479b21f0a217e7ef8130281ab2904fbe5ce2a0de5

Contents?: true

Size: 726 Bytes

Versions: 21

Compression:

Stored size: 726 Bytes

Contents

# Change this file to be a wrapper around your daemon code.

# Do your post daemonization configuration here
# At minimum you need just the first line (without the block), or a lot
# of strange things might start happening...
DaemonKit::Application.running! do |config|
  # Trap signals with blocks or procs
  # config.trap( 'INT' ) do
  #   # do something clever
  # end
  # config.trap( 'TERM', Proc.new { puts 'Going down' } )
end


DaemonKit::XMPP.run do
  when_ready { DaemonKit.logger.info "Connected as #{jid}" }

  # Auto approve subscription requests
  subscription :request? do |s|
    write_to_stream s.approve!
  end

  # Echo back what was said
  message :chat?, :body do |m|
    write_to_stream m.reply
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
daemon-kit-0.3.3 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.3.2 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.3.1 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.3.0 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.3.0.rc2 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.3.0.rc1 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.2.3 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.2.1 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.2.0 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8.2 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
amqp-daemon-kit-1.0.1 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
amqp-daemon-kit-0.1.8.2 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
amqp-daemon-kit-0.1.8.1 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8.1 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8rc3 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
textgoeshere-daemon-kit-0.1.8.31 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
textgoeshere-daemon-kit-0.1.8rc3 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8rc2 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb
daemon-kit-0.1.8rc1 lib/generators/daemon_kit/xmpp/templates/libexec/%app_name%-daemon.rb