apotomo 1.2.0 → 1.2.1
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/version.rb +1 -1
- data/lib/apotomo/widget.rb +4 -2
- data/test/rails/view_helper_test.rb +3 -11
- metadata +3 -3
data/CHANGES.textile
CHANGED
data/lib/apotomo/version.rb
CHANGED
data/lib/apotomo/widget.rb
CHANGED
@@ -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
|
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
|
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
|
-
|
11
|
-
|
12
|
-
|
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
|
-
-
|
9
|
-
version: 1.2.
|
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-
|
17
|
+
date: 2011-10-14 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|