Class: ProcessController::TestDaemon

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-process-controller/test_daemon.rb

Overview

Copyright 2006-2009 Stanislav Senotrusov <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Constant Summary collapse

SLEEP_FOR =
100

Instance Method Summary collapse

Instance Method Details

#apply_options(options) ⇒ Object



24
25
26
# File 'lib/ruby-process-controller/test_daemon.rb', line 24

def apply_options(options)
  puts options.inspect
end

#define_options(options) ⇒ Object



19
20
21
22
# File 'lib/ruby-process-controller/test_daemon.rb', line 19

def define_options(options)
  options.header << "Test Daemon"
  options.option "--foo FOO", "Foo option"
end

#startObject



28
29
30
31
32
# File 'lib/ruby-process-controller/test_daemon.rb', line 28

def start
  puts "#{self.class.inspect} STARTED"
  puts "#{self.class.inspect} SLEEPING FOR #{SLEEP_FOR} seconds..."
  sleep SLEEP_FOR
end

#stopObject



34
35
36
# File 'lib/ruby-process-controller/test_daemon.rb', line 34

def stop
  puts "#{self.class.inspect} STOP method"
end