Module: Filigree::Application
- Includes:
- ClassMethodsModule
- Defined in:
- lib/filigree/application.rb
Overview
The beginnings of a general purpose application module. The aim is to provide the basic framework for larger desktop and command line applications.
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- REQUIRED_METHODS =
Constants #
[ :kill, :pause, :resume, :run, :stop ]
Instance Attribute Summary collapse
-
#configuration ⇒ Object
(also: #config)
Instance Methods #.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#configuration ⇒ Object Also known as: config
Instance Methods #
50 51 52 |
# File 'lib/filigree/application.rb', line 50 def configuration @configuration end |
Class Method Details
.included(klass) ⇒ Object
101 102 103 104 |
# File 'lib/filigree/application.rb', line 101 def included(klass) old_included(klass) klass.const_set(:Configuration, Class.new { include Filigree::Configuration }) end |
.old_included ⇒ Object
99 |
# File 'lib/filigree/application.rb', line 99 alias :old_included :included |
Instance Method Details
#initialize ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/filigree/application.rb', line 53 def initialize @configuration = self.class::Configuration.new # Set up signal handlers. Signal.trap('ABRT') { self.stop } Signal.trap('INT') { self.stop } Signal.trap('QUIT') { self.stop } Signal.trap('TERM') { self.stop } Signal.trap('KILL') { self.kill } Signal.trap('CONT') { self.resume } Signal.trap('STOP') { self.pause } end |