apotomo 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.textile CHANGED
@@ -1,3 +1,8 @@
1
+ h2. 1.2.1
2
+
3
+ h3. Changes
4
+ * Save the <code>@options</code> hash in the constructor since we cannot rely on cells anymore.
5
+
1
6
  h2. 1.2.0
2
7
 
3
8
  h3. Changes
@@ -1,3 +1,3 @@
1
1
  module Apotomo
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
@@ -72,6 +72,7 @@ module Apotomo
72
72
  undef :display # We don't want #display to be listed in #internal_methods.
73
73
 
74
74
  alias_method :widget_id, :name
75
+ attr_reader :options
75
76
 
76
77
  after_initialize do
77
78
  run_hook :has_widgets, self
@@ -79,7 +80,8 @@ module Apotomo
79
80
 
80
81
 
81
82
  def initialize(parent, id, options={})
82
- super(parent, options) # TODO: do that as long as cells do need a parent_controller. remember to remove options for cells 3.7.
83
+ super(parent) # TODO: do that as long as cells do need a parent_controller.
84
+ @options = options
83
85
  @name = id
84
86
  @visible = true
85
87
 
@@ -99,7 +101,7 @@ module Apotomo
99
101
 
100
102
  # Invokes +state+ and hopefully returns the rendered content.
101
103
  def invoke(state, *args)
102
- return render_state(state, *args) if state_accepts_args?(state)
104
+ return render_state(state, *args) if method(state).arity != 0 # TODO: remove check and make trigger states receive the evt default.
103
105
  render_state(state)
104
106
  end
105
107
 
@@ -7,17 +7,9 @@ class ViewHelperTest < Apotomo::TestCase
7
7
 
8
8
  # TODO: use Cell::TestCase#in_view here.
9
9
  def in_view(subject, &block)
10
- if subject.kind_of?(Apotomo::Widget)
11
- subject.options[:block] = block
12
- else
13
- subject = subject.new(@controller, 'mum', :block => block)
14
- end
15
-
16
- setup_test_states_in(subject) unless subject.respond_to?(:in_view)# add #in_view state to subject cell.
17
-
18
- subject.class.action_methods << "in_view"
19
-
20
- subject.invoke(:in_view)
10
+ subject = subject.new(@controller, :mum) unless subject.kind_of?(Apotomo::Widget)
11
+ setup_test_states_in(subject)
12
+ subject.invoke(:in_view, block)
21
13
  end
22
14
  def mouse_mock(id='mum', opts={}, &block)
23
15
  mouse = MouseWidget.new(parent_controller, id, opts)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 0
9
- version: 1.2.0
8
+ - 1
9
+ version: 1.2.1
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-10-12 00:00:00 +02:00
17
+ date: 2011-10-14 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency