apotomo 1.0.4 → 1.0.5
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/CHANGES.textile +5 -0
- data/lib/apotomo/event_methods.rb +3 -3
- data/lib/apotomo/version.rb +1 -1
- data/test/unit/event_methods_test.rb +6 -0
- metadata +3 -3
data/CHANGES.textile
CHANGED
@@ -57,9 +57,9 @@ module Apotomo
|
|
57
57
|
# It is important to understand the <tt>:from</tt> parameter as it filters the event source - it wouldn't make
|
58
58
|
# sense to refill the mouse trap if the bear trap snapped, would it?
|
59
59
|
def respond_to_event(type, options={})
|
60
|
-
options.reverse_merge
|
61
|
-
|
62
|
-
|
60
|
+
options = options.reverse_merge(:once => true,
|
61
|
+
:with => type,
|
62
|
+
:on => self.name)
|
63
63
|
|
64
64
|
handler = InvokeEventHandler.new(:widget_id => options[:on], :state => options[:with])
|
65
65
|
|
data/lib/apotomo/version.rb
CHANGED
@@ -75,6 +75,12 @@ class EventMethodsTest < Test::Unit::TestCase
|
|
75
75
|
should "not inherit handlers for now" do
|
76
76
|
assert_equal [], BabyMouseCell.new(parent_controller, 'kid', :show).event_table.all_handlers_for(:peep, 'kid')
|
77
77
|
end
|
78
|
+
|
79
|
+
should "not add the same handler to each instance" do
|
80
|
+
assert_equal [Apotomo::InvokeEventHandler.new(:widget_id => 'mum', :state => :answer_squeak)], AdultMouseCell.new(parent_controller, 'mum', :show).event_table.all_handlers_for(:peep, 'mum')
|
81
|
+
|
82
|
+
assert_equal [Apotomo::InvokeEventHandler.new(:widget_id => 'dad', :state => :answer_squeak)], AdultMouseCell.new(parent_controller, 'dad', :show).event_table.all_handlers_for(:peep, 'dad')
|
83
|
+
end
|
78
84
|
end
|
79
85
|
|
80
86
|
context "#trigger" do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 5
|
9
|
+
version: 1.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nick Sutterer
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-02-
|
17
|
+
date: 2011-02-23 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|