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.
@@ -1,3 +1,8 @@
1
+ h2. 1.0.5
2
+
3
+ h3. Bugfixes
4
+ * Fixed a bug in Widget.responds_to_event. Thanks to Scott Rainey for urging.
5
+
1
6
  h2. 1.0.4
2
7
 
3
8
  h3. Bugfixes
@@ -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!( :once => true,
61
- :with => type,
62
- :on => self.name )
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
 
@@ -1,3 +1,3 @@
1
1
  module Apotomo
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  end
@@ -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
- - 4
9
- version: 1.0.4
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-09 00:00:00 +01:00
17
+ date: 2011-02-23 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency