Sutto-perennial 0.2.3.6 → 0.2.3.7

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.
data/lib/perennial.rb CHANGED
@@ -9,7 +9,7 @@ require 'perennial/exceptions'
9
9
 
10
10
  module Perennial
11
11
 
12
- VERSION = "0.2.3.6"
12
+ VERSION = "0.2.3.7"
13
13
 
14
14
  has_library :dispatchable, :hookable, :loader, :logger,
15
15
  :loggable, :manifest, :settings, :argument_parser,
@@ -46,8 +46,8 @@ module Perennial
46
46
  # == Params
47
47
  # +name+: The name of the current event
48
48
  # +opts+: an optional hash of options to pass
49
- def dispatch(name, opts = {}, force = false)
50
- if dispatch_queue.empty? || force
49
+ def dispatch(name, opts = {}, from_queue = false)
50
+ if dispatch_queue.empty? || from_queue
51
51
  Logger.debug "Dispatching #{name} event (#{dispatch_queue.size} queued - on #{self.class.name})"
52
52
  begin
53
53
  # The full handler name is the method we call given it exists.
@@ -77,7 +77,8 @@ module Perennial
77
77
  rescue Exception => e
78
78
  Logger.log_exception(e)
79
79
  end
80
- dispatch(*dispatch_queue.shift) unless dispatch_queue.empty?
80
+ dispatch_queue.shift if from_queue
81
+ dispatch(*dispatch_queue.first) unless dispatch_queue.empty?
81
82
  else
82
83
  Logger.debug "Adding #{name} event to the end of the queue (on #{self.class.name})"
83
84
  dispatch_queue << [name, opts, true]
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.3.6
4
+ version: 0.2.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darcy Laycock
@@ -73,7 +73,6 @@ files:
73
73
  - templates/test_helper.erb
74
74
  has_rdoc: false
75
75
  homepage: http://sutto.net/
76
- licenses:
77
76
  post_install_message:
78
77
  rdoc_options: []
79
78
 
@@ -94,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
93
  requirements: []
95
94
 
96
95
  rubyforge_project:
97
- rubygems_version: 1.3.5
96
+ rubygems_version: 1.2.0
98
97
  signing_key:
99
98
  specification_version: 3
100
99
  summary: A simple (generally event-oriented) application library for Ruby