Sutto-perennial 0.2.2 → 0.2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,14 +6,14 @@ module Perennial
6
6
  include Perennial::Hookable
7
7
 
8
8
  cattr_accessor :controllers, :current_type, :default_type
9
- @@controllers = []
9
+ @@controllers = {}
10
10
 
11
11
  define_hook :before_run, :after_stop
12
12
 
13
13
  def self.register_controller(name, controller)
14
14
  return if name.blank? || controller.blank?
15
15
  name = name.to_sym
16
- @@controller[name] = controller
16
+ @@controllers[name] = controller
17
17
  metaclass.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
18
18
  def #{name}? # def client?
19
19
  @@current_type == :#{name} # @@current_type == :client
@@ -32,7 +32,6 @@ module Perennial
32
32
 
33
33
  def run!
34
34
  self.register_signals
35
- OptionParser.parse_argv
36
35
  self.class.invoke_hooks! :before_setup
37
36
  Daemon.daemonize! if Settings.daemon?
38
37
  Logger.log_name = "#{@@current_type.to_s}.log"
@@ -64,7 +63,7 @@ module Perennial
64
63
  begin
65
64
  config_dir = Settings.root / "config"
66
65
  setup_file = config_dir / "setup.rb"
67
- require(setup_file) if File.directory?(handler_directory) && File.exist?(setup_file)
66
+ require(setup_file) if File.directory?(config_dir) && File.exist?(setup_file)
68
67
  rescue LoadError
69
68
  end
70
69
  # Load any existing handlers assuming we can find the folder
@@ -45,10 +45,6 @@ module Perennial
45
45
  return nil
46
46
  end
47
47
 
48
- def self.method_missing(name, *args, &blk)
49
- self.default.send(name, *args, &blk)
50
- end
51
-
52
48
  # Over ride with your apps custom banner
53
49
  def self.print_banner
54
50
  end
@@ -81,7 +77,7 @@ module Perennial
81
77
  @default = setup_default!
82
78
  end
83
79
 
84
- def parse_argv(with = default)
80
+ def self.parse_argv(with = default)
85
81
  with.parse
86
82
  ARGV.replace with.arguments
87
83
  end
data/lib/perennial.rb CHANGED
@@ -8,7 +8,7 @@ require 'perennial/exceptions'
8
8
 
9
9
  module Perennial
10
10
 
11
- VERSION = "0.2.2"
11
+ VERSION = "0.2.2.1"
12
12
 
13
13
  has_libary :dispatchable, :hookable, :loader, :logger,
14
14
  :loggable, :manifest, :settings, :argument_parser,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Sutto-perennial
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darcy Laycock