has-guarded-handlers 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.1.1
2
+ * Bugfix: Fix an exception when triggering an event when no handlers are set
3
+
1
4
  # 0.1.0
2
5
  * Allow setting a priority with which to execute a handler, where higher priority handlers are exectuted first
3
6
 
@@ -48,7 +48,7 @@ module HasGuardedHandlers
48
48
  private
49
49
 
50
50
  def handlers_of_type(type)
51
- hash = @handlers[type]
51
+ return unless hash = @handlers[type]
52
52
  values = []
53
53
  hash.keys.sort.reverse.each do |key|
54
54
  values += hash[key]
@@ -1,3 +1,3 @@
1
1
  module HasGuardedHandlers
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -13,6 +13,12 @@ describe TestObject do
13
13
  subject.trigger_handler :event, event
14
14
  end
15
15
 
16
+ it 'does not fail when no handlers are set' do
17
+ lambda do
18
+ subject.trigger_handler :event, event
19
+ end.should_not raise_error
20
+ end
21
+
16
22
  it 'allows for breaking out of handlers' do
17
23
  response.expects(:handle).once
18
24
  response.expects(:fail).never
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has-guarded-handlers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,12 +10,12 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-10-28 00:00:00.000000000 +01:00
13
+ date: 2011-10-30 01:00:00.000000000 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
18
- requirement: &2165367660 !ruby/object:Gem::Requirement
18
+ requirement: &2165053140 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 1.0.0
24
24
  type: :development
25
25
  prerelease: false
26
- version_requirements: *2165367660
26
+ version_requirements: *2165053140
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
- requirement: &2165366980 !ruby/object:Gem::Requirement
29
+ requirement: &2165052200 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 2.5.0
35
35
  type: :development
36
36
  prerelease: false
37
- version_requirements: *2165366980
37
+ version_requirements: *2165052200
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: mocha
40
- requirement: &2165366340 !ruby/object:Gem::Requirement
40
+ requirement: &2165051720 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :development
47
47
  prerelease: false
48
- version_requirements: *2165366340
48
+ version_requirements: *2165051720
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: ci_reporter
51
- requirement: &2165365700 !ruby/object:Gem::Requirement
51
+ requirement: &2165051160 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: 1.6.3
57
57
  type: :development
58
58
  prerelease: false
59
- version_requirements: *2165365700
59
+ version_requirements: *2165051160
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: yard
62
- requirement: &2165365060 !ruby/object:Gem::Requirement
62
+ requirement: &2165050660 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: 0.7.0
68
68
  type: :development
69
69
  prerelease: false
70
- version_requirements: *2165365060
70
+ version_requirements: *2165050660
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rake
73
- requirement: &2165364420 !ruby/object:Gem::Requirement
73
+ requirement: &2165050140 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *2165364420
81
+ version_requirements: *2165050140
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: guard-rspec
84
- requirement: &2165363900 !ruby/object:Gem::Requirement
84
+ requirement: &2165049620 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *2165363900
92
+ version_requirements: *2165049620
93
93
  description: Allow an object's API to provide flexible handler registration, storage
94
94
  and matching to arbitrary events.
95
95
  email: