apotomo 1.2.2 → 1.2.3

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,12 @@
1
- rvm: 1.9.2
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - rbx-18mode
6
+ - rbx-19mode
7
+ - ree
8
+ - jruby-18mode
9
+ - jruby-19mode
10
+ - jruby-head
2
11
  notifications:
3
12
  irc: "irc.freenode.org#cells"
@@ -1,3 +1,7 @@
1
+ h2. 1.2.3
2
+
3
+ * Maintenance release to make happy people happy.
4
+
1
5
  h2. 1.2.2
2
6
 
3
7
  * Derive @Apotomo::Widget@ from @Cell::Rails@ now to make it compatible with 3.8.
@@ -44,7 +44,7 @@ Let's wrap that comments block in a widget.
44
44
 
45
45
  Go and generate a widget stub.
46
46
 
47
- $ rails generate apotomo:widget CommentsWidget display write -e haml
47
+ $ rails generate apotomo:widget Comments display write -e haml
48
48
  create app/cells/
49
49
  create app/cells/comments_widget
50
50
  create app/cells/comments_widget.rb
@@ -62,10 +62,10 @@ You now tell your controller about the new widget.
62
62
  include Apotomo::Rails::ControllerMethods
63
63
 
64
64
  has_widgets do |root|
65
- root << widget('comments_widget', 'post-comments', :post => @post)
65
+ root << widget(:comments, :post => @post)
66
66
  end
67
67
 
68
- The widget is named <tt>post-comments</tt>. We pass the current post into the widget - the block is executed in controller instance context, that's were <tt>@post</tt> comes from. Handy, isn't it?
68
+ This creates a widget instance called <tt>comments_widget</tt> from the class CommentsWidget. We pass the current post into the widget - the block is executed in controller instance context, that's were <tt>@post</tt> comes from. Handy, isn't it?
69
69
 
70
70
  == Render the widget
71
71
 
@@ -77,7 +77,7 @@ Rendering usually happens in your controller view, <tt>views/posts/show.html.ham
77
77
  @post.body
78
78
 
79
79
  %p
80
- = render_widget 'post-comments'
80
+ = render_widget :comments
81
81
 
82
82
  == Write the widget
83
83
 
@@ -148,7 +148,7 @@ Also, updating the page is in your hands. Where Apotomo provides handy helpers a
148
148
 
149
149
  Look, +replace+ basically generates
150
150
 
151
- $("post-comments").replaceWith(<the rendered view>);
151
+ $("comments").replaceWith(<the rendered view>);
152
152
 
153
153
  If that's not what you want, do
154
154
 
@@ -166,11 +166,11 @@ Apotomo comes with its own test case and assertions to <b>build rock-solid web c
166
166
 
167
167
  class CommentsWidgetTest < Apotomo::TestCase
168
168
  has_widgets do |root|
169
- root << widget(:comments_widget, 'me', :post => @pervert_post)
169
+ root << widget(:comments, :post => @pervert_post)
170
170
  end
171
171
 
172
172
  def test_render
173
- render_widget 'me'
173
+ render_widget :comments
174
174
  assert_select "li#me"
175
175
 
176
176
  trigger :post, :comment => {:text => "Sex on the beach"}
@@ -202,4 +202,4 @@ If you wanna be cool, subscribe to our feed[http://feeds.feedburner.com/Apotomo]
202
202
 
203
203
 
204
204
  == License
205
- Copyright (c) 2007-2011 Nick Sutterer <apotonick@gmail.com> under the MIT License
205
+ Copyright (c) 2007-2012 Nick Sutterer <apotonick@gmail.com> under the MIT License
@@ -34,54 +34,52 @@ module Apotomo
34
34
  module TestMethods
35
35
  extend ActiveSupport::Concern
36
36
 
37
- module InstanceMethods
38
- include Cell::TestCase::CommonTestMethods
37
+ include Cell::TestCase::CommonTestMethods
38
+
39
+ attr_reader :view_assigns
40
+
41
+ def setup
42
+ super # defined in Cell::TestCase::CommonTestMethods.
39
43
 
40
- attr_reader :view_assigns
41
-
42
- def setup
43
- super # defined in Cell::TestCase::CommonTestMethods.
44
-
45
- @controller.instance_eval do
46
- def controller_path
47
- 'barn'
48
- end
44
+ @controller.instance_eval do
45
+ def controller_path
46
+ 'barn'
49
47
  end
50
- @controller.extend Apotomo::Rails::ControllerMethods
51
48
  end
52
-
53
- # Renders the widget +name+.
54
- def render_widget(*args)
55
- @view_assigns = extract_state_ivars_for(root[args.first]) do
56
- @last_invoke = root.render_widget(*args)
57
- end
58
-
59
- @last_invoke
49
+ @controller.extend Apotomo::Rails::ControllerMethods
50
+ end
51
+
52
+ # Renders the widget +name+.
53
+ def render_widget(*args)
54
+ @view_assigns = extract_state_ivars_for(root[args.first]) do
55
+ @last_invoke = root.render_widget(*args)
60
56
  end
57
+
58
+ @last_invoke
59
+ end
61
60
 
62
- # Triggers an event of +type+. You have to pass the +source+ as second options.
63
- #
64
- # Example:
65
- #
66
- # trigger :submit, :comments
67
- def trigger(type, source, options={})
68
- source = root.find_widget(source)
69
- source.fire(type, options)
70
- root.page_updates
71
- end
61
+ # Triggers an event of +type+. You have to pass the +source+ as second options.
62
+ #
63
+ # Example:
64
+ #
65
+ # trigger :submit, :comments
66
+ def trigger(type, source, options={})
67
+ source = root.find_widget(source)
68
+ source.fire(type, options)
69
+ root.page_updates
70
+ end
72
71
 
73
- # Returns the widget tree from TestCase.has_widgets.
74
- def root
75
- blk = self.class.has_widgets_blocks or raise "Please setup a widget tree using has_widgets()"
76
- @root ||= Apotomo::Widget.new(parent_controller, "root").tap do |root|
77
- self.instance_exec(root, &blk)
78
- end
79
- end
80
-
81
- def parent_controller
82
- @controller
72
+ # Returns the widget tree from TestCase.has_widgets.
73
+ def root
74
+ blk = self.class.has_widgets_blocks or raise "Please setup a widget tree using has_widgets()"
75
+ @root ||= Apotomo::Widget.new(parent_controller, "root").tap do |root|
76
+ self.instance_exec(root, &blk)
83
77
  end
84
78
  end
79
+
80
+ def parent_controller
81
+ @controller
82
+ end
85
83
 
86
84
  module ClassMethods
87
85
  def has_widgets_blocks
@@ -1,3 +1,3 @@
1
1
  module Apotomo
2
- VERSION = '1.2.2'
2
+ VERSION = '1.2.3'
3
3
  end
@@ -110,7 +110,11 @@ class WidgetTest < ActiveSupport::TestCase
110
110
  end
111
111
 
112
112
  should "respond to .view_paths" do
113
- assert_equal ActionView::PathSet.new(Apotomo::Widget::DEFAULT_VIEW_PATHS + ["test/widgets"]), Apotomo::Widget.view_paths
113
+ if Cells.rails3_2_or_more?
114
+ assert_equal ActionView::PathSet.new(Apotomo::Widget::DEFAULT_VIEW_PATHS + ["test/widgets"]).paths, Apotomo::Widget.view_paths.paths
115
+ else
116
+ assert_equal ActionView::PathSet.new(Apotomo::Widget::DEFAULT_VIEW_PATHS + ["test/widgets"]), Apotomo::Widget.view_paths
117
+ end
114
118
  end
115
119
 
116
120
  should "respond to .controller_path" do
metadata CHANGED
@@ -1,142 +1,112 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: apotomo
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 2
8
- - 2
9
- version: 1.2.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.3
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Nick Sutterer
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-12-21 00:00:00 +01:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-05-08 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: cells
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &74978860 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 3
30
- - 6
31
- - 7
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
32
21
  version: 3.6.7
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: onfire
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *74978860
25
+ - !ruby/object:Gem::Dependency
26
+ name: onfire
27
+ requirement: &74978510 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
29
+ requirements:
41
30
  - - ~>
42
- - !ruby/object:Gem::Version
43
- segments:
44
- - 0
45
- - 2
46
- - 0
31
+ - !ruby/object:Gem::Version
47
32
  version: 0.2.0
48
33
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: hooks
52
34
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *74978510
36
+ - !ruby/object:Gem::Dependency
37
+ name: hooks
38
+ requirement: &74978060 !ruby/object:Gem::Requirement
54
39
  none: false
55
- requirements:
40
+ requirements:
56
41
  - - ~>
57
- - !ruby/object:Gem::Version
58
- segments:
59
- - 0
60
- - 2
61
- - 0
42
+ - !ruby/object:Gem::Version
62
43
  version: 0.2.0
63
44
  type: :runtime
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- name: shoulda
67
45
  prerelease: false
68
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *74978060
47
+ - !ruby/object:Gem::Dependency
48
+ name: shoulda
49
+ requirement: &74977250 !ruby/object:Gem::Requirement
69
50
  none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- segments:
74
- - 0
75
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
76
55
  type: :development
77
- version_requirements: *id004
78
- - !ruby/object:Gem::Dependency
79
- name: rake
80
56
  prerelease: false
81
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *74977250
58
+ - !ruby/object:Gem::Dependency
59
+ name: rake
60
+ requirement: &74976840 !ruby/object:Gem::Requirement
82
61
  none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- segments:
87
- - 0
88
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
89
66
  type: :development
90
- version_requirements: *id005
91
- - !ruby/object:Gem::Dependency
92
- name: slim
93
67
  prerelease: false
94
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *74976840
69
+ - !ruby/object:Gem::Dependency
70
+ name: slim
71
+ requirement: &74966910 !ruby/object:Gem::Requirement
95
72
  none: false
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- segments:
100
- - 0
101
- version: "0"
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
102
77
  type: :development
103
- version_requirements: *id006
104
- - !ruby/object:Gem::Dependency
105
- name: haml
106
78
  prerelease: false
107
- requirement: &id007 !ruby/object:Gem::Requirement
79
+ version_requirements: *74966910
80
+ - !ruby/object:Gem::Dependency
81
+ name: haml
82
+ requirement: &74966580 !ruby/object:Gem::Requirement
108
83
  none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- segments:
113
- - 0
114
- version: "0"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
115
88
  type: :development
116
- version_requirements: *id007
117
- - !ruby/object:Gem::Dependency
118
- name: tzinfo
119
89
  prerelease: false
120
- requirement: &id008 !ruby/object:Gem::Requirement
90
+ version_requirements: *74966580
91
+ - !ruby/object:Gem::Dependency
92
+ name: tzinfo
93
+ requirement: &74966340 !ruby/object:Gem::Requirement
121
94
  none: false
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- segments:
126
- - 0
127
- version: "0"
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
128
99
  type: :development
129
- version_requirements: *id008
130
- description: Web component framework for Rails providing widgets that trigger events and know when and how to update themselves with AJAX.
131
- email:
100
+ prerelease: false
101
+ version_requirements: *74966340
102
+ description: Web component framework for Rails providing widgets that trigger events
103
+ and know when and how to update themselves with AJAX.
104
+ email:
132
105
  - apotonick@gmail.com
133
106
  executables: []
134
-
135
107
  extensions: []
136
-
137
108
  extra_rdoc_files: []
138
-
139
- files:
109
+ files:
140
110
  - .gitignore
141
111
  - .travis.yml
142
112
  - CHANGES.textile
@@ -226,37 +196,28 @@ files:
226
196
  - test/widgets/mouse/feed.html.erb
227
197
  - test/widgets/mouse/make_me_squeak.html.erb
228
198
  - test/widgets/mouse/snuggle.html.erb
229
- has_rdoc: true
230
199
  homepage: http://github.com/apotonick/apotomo
231
200
  licenses: []
232
-
233
201
  post_install_message:
234
202
  rdoc_options: []
235
-
236
- require_paths:
203
+ require_paths:
237
204
  - lib
238
- required_ruby_version: !ruby/object:Gem::Requirement
205
+ required_ruby_version: !ruby/object:Gem::Requirement
239
206
  none: false
240
- requirements:
241
- - - ">="
242
- - !ruby/object:Gem::Version
243
- segments:
244
- - 0
245
- version: "0"
246
- required_rubygems_version: !ruby/object:Gem::Requirement
207
+ requirements:
208
+ - - ! '>='
209
+ - !ruby/object:Gem::Version
210
+ version: '0'
211
+ required_rubygems_version: !ruby/object:Gem::Requirement
247
212
  none: false
248
- requirements:
249
- - - ">="
250
- - !ruby/object:Gem::Version
251
- segments:
252
- - 0
253
- version: "0"
213
+ requirements:
214
+ - - ! '>='
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
254
217
  requirements: []
255
-
256
218
  rubyforge_project:
257
- rubygems_version: 1.3.7
219
+ rubygems_version: 1.8.10
258
220
  signing_key:
259
221
  specification_version: 3
260
222
  summary: Web components for Rails.
261
223
  test_files: []
262
-