apotomo 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/Gemfile +10 -0
  2. data/Gemfile.lock +47 -0
  3. data/README +141 -0
  4. data/README.rdoc +141 -0
  5. data/Rakefile +78 -0
  6. data/TODO +36 -0
  7. data/app/cells/apotomo/child_switch_widget/switch.html.erb +1 -0
  8. data/app/cells/apotomo/child_switch_widget/switch.rhtml +1 -0
  9. data/app/cells/apotomo/deep_link_widget.rb +27 -0
  10. data/app/cells/apotomo/deep_link_widget/setup.html.erb +20 -0
  11. data/app/cells/apotomo/java_script_widget.rb +12 -0
  12. data/app/cells/apotomo/tab_panel_widget.rb +87 -0
  13. data/app/cells/apotomo/tab_panel_widget/display.html.erb +57 -0
  14. data/app/cells/apotomo/tab_widget.rb +18 -0
  15. data/app/cells/apotomo/tab_widget/display.html.erb +1 -0
  16. data/config/routes.rb +3 -0
  17. data/generators/widget/USAGE +15 -0
  18. data/generators/widget/templates/functional_test.rb +8 -0
  19. data/generators/widget/templates/view.html.erb +2 -0
  20. data/generators/widget/templates/view.html.haml +3 -0
  21. data/generators/widget/templates/widget.rb +8 -0
  22. data/generators/widget/widget_generator.rb +34 -0
  23. data/lib/apotomo.rb +59 -0
  24. data/lib/apotomo/caching.rb +37 -0
  25. data/lib/apotomo/container_widget.rb +10 -0
  26. data/lib/apotomo/deep_link_methods.rb +90 -0
  27. data/lib/apotomo/event.rb +9 -0
  28. data/lib/apotomo/event_handler.rb +23 -0
  29. data/lib/apotomo/event_methods.rb +102 -0
  30. data/lib/apotomo/invoke_event_handler.rb +24 -0
  31. data/lib/apotomo/javascript_generator.rb +57 -0
  32. data/lib/apotomo/persistence.rb +139 -0
  33. data/lib/apotomo/proc_event_handler.rb +18 -0
  34. data/lib/apotomo/rails/controller_methods.rb +161 -0
  35. data/lib/apotomo/rails/view_helper.rb +95 -0
  36. data/lib/apotomo/rails/view_methods.rb +7 -0
  37. data/lib/apotomo/request_processor.rb +92 -0
  38. data/lib/apotomo/stateful_widget.rb +8 -0
  39. data/lib/apotomo/transition.rb +46 -0
  40. data/lib/apotomo/tree_node.rb +186 -0
  41. data/lib/apotomo/version.rb +5 -0
  42. data/lib/apotomo/widget.rb +289 -0
  43. data/lib/apotomo/widget_shortcuts.rb +36 -0
  44. data/rails/init.rb +0 -0
  45. data/test/fixtures/application_widget_tree.rb +2 -0
  46. data/test/rails/controller_methods_test.rb +206 -0
  47. data/test/rails/rails_integration_test.rb +99 -0
  48. data/test/rails/view_helper_test.rb +77 -0
  49. data/test/rails/view_methods_test.rb +40 -0
  50. data/test/rails/widget_generator_test.rb +47 -0
  51. data/test/support/assertions_helper.rb +13 -0
  52. data/test/support/test_case_methods.rb +68 -0
  53. data/test/test_helper.rb +77 -0
  54. data/test/unit/apotomo_test.rb +20 -0
  55. data/test/unit/container_test.rb +20 -0
  56. data/test/unit/event_handler_test.rb +67 -0
  57. data/test/unit/event_methods_test.rb +83 -0
  58. data/test/unit/event_test.rb +30 -0
  59. data/test/unit/invoke_test.rb +123 -0
  60. data/test/unit/javascript_generator_test.rb +90 -0
  61. data/test/unit/onfire_integration_test.rb +19 -0
  62. data/test/unit/persistence_test.rb +240 -0
  63. data/test/unit/render_test.rb +203 -0
  64. data/test/unit/request_processor_test.rb +178 -0
  65. data/test/unit/stateful_widget_test.rb +135 -0
  66. data/test/unit/test_addressing.rb +111 -0
  67. data/test/unit/test_caching.rb +54 -0
  68. data/test/unit/test_jump_to_state.rb +89 -0
  69. data/test/unit/test_tab_panel.rb +72 -0
  70. data/test/unit/test_widget_shortcuts.rb +45 -0
  71. data/test/unit/transition_test.rb +33 -0
  72. data/test/unit/widget_shortcuts_test.rb +68 -0
  73. data/test/unit/widget_test.rb +24 -0
  74. metadata +215 -0
@@ -0,0 +1,24 @@
1
+ require File.join(File.dirname(__FILE__), '..', 'test_helper')
2
+
3
+ class WidgetTest < ActiveSupport::TestCase
4
+ context "#has_widgets in class context" do
5
+ setup do
6
+ @mum = Class.new(MouseCell) do
7
+ has_widgets do |me|
8
+ me << widget('mouse_cell', 'baby', :squeak)
9
+ end
10
+ end.new('mum', :squeak)
11
+
12
+ @kid = Class.new(@mum.class).new('mum', :squeak)
13
+ end
14
+
15
+ should "setup the widget family at creation time" do
16
+ assert_equal 1, @mum.children.size
17
+ assert_kind_of Apotomo::StatefulWidget, @mum['baby']
18
+ end
19
+
20
+ should "not inherit trees for now" do
21
+ assert_equal [], @kid.children
22
+ end
23
+ end
24
+ end
metadata ADDED
@@ -0,0 +1,215 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: apotomo
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 1
10
+ version: 0.1.1
11
+ platform: ruby
12
+ authors:
13
+ - Nick Sutterer
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-08-24 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: cells
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 1
29
+ segments:
30
+ - 3
31
+ - 3
32
+ version: "3.3"
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: activesupport
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 2
46
+ - 3
47
+ - 0
48
+ version: 2.3.0
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: onfire
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ hash: 27
60
+ segments:
61
+ - 0
62
+ - 1
63
+ - 0
64
+ version: 0.1.0
65
+ type: :runtime
66
+ prerelease: false
67
+ version_requirements: *id003
68
+ description: A generic widget framework for Rails. Event-driven. Clean. Fast. Free optional statefulness included.
69
+ email: apotonick@gmail.com
70
+ executables: []
71
+
72
+ extensions: []
73
+
74
+ extra_rdoc_files:
75
+ - README
76
+ - README.rdoc
77
+ - TODO
78
+ files:
79
+ - Gemfile
80
+ - Gemfile.lock
81
+ - README
82
+ - README.rdoc
83
+ - Rakefile
84
+ - TODO
85
+ - app/cells/apotomo/child_switch_widget/switch.html.erb
86
+ - app/cells/apotomo/child_switch_widget/switch.rhtml
87
+ - app/cells/apotomo/deep_link_widget.rb
88
+ - app/cells/apotomo/deep_link_widget/setup.html.erb
89
+ - app/cells/apotomo/java_script_widget.rb
90
+ - app/cells/apotomo/tab_panel_widget.rb
91
+ - app/cells/apotomo/tab_panel_widget/display.html.erb
92
+ - app/cells/apotomo/tab_widget.rb
93
+ - app/cells/apotomo/tab_widget/display.html.erb
94
+ - config/routes.rb
95
+ - generators/widget/USAGE
96
+ - generators/widget/templates/functional_test.rb
97
+ - generators/widget/templates/view.html.erb
98
+ - generators/widget/templates/view.html.haml
99
+ - generators/widget/templates/widget.rb
100
+ - generators/widget/widget_generator.rb
101
+ - lib/apotomo.rb
102
+ - lib/apotomo/caching.rb
103
+ - lib/apotomo/container_widget.rb
104
+ - lib/apotomo/deep_link_methods.rb
105
+ - lib/apotomo/event.rb
106
+ - lib/apotomo/event_handler.rb
107
+ - lib/apotomo/event_methods.rb
108
+ - lib/apotomo/invoke_event_handler.rb
109
+ - lib/apotomo/javascript_generator.rb
110
+ - lib/apotomo/persistence.rb
111
+ - lib/apotomo/proc_event_handler.rb
112
+ - lib/apotomo/rails/controller_methods.rb
113
+ - lib/apotomo/rails/view_helper.rb
114
+ - lib/apotomo/rails/view_methods.rb
115
+ - lib/apotomo/request_processor.rb
116
+ - lib/apotomo/stateful_widget.rb
117
+ - lib/apotomo/transition.rb
118
+ - lib/apotomo/tree_node.rb
119
+ - lib/apotomo/version.rb
120
+ - lib/apotomo/widget.rb
121
+ - lib/apotomo/widget_shortcuts.rb
122
+ - rails/init.rb
123
+ - test/fixtures/application_widget_tree.rb
124
+ - test/test_helper.rb
125
+ - test/support/test_case_methods.rb
126
+ - test/support/assertions_helper.rb
127
+ - test/rails/rails_integration_test.rb
128
+ - test/rails/view_methods_test.rb
129
+ - test/rails/controller_methods_test.rb
130
+ - test/rails/view_helper_test.rb
131
+ - test/rails/widget_generator_test.rb
132
+ - test/unit/onfire_integration_test.rb
133
+ - test/unit/invoke_test.rb
134
+ - test/unit/request_processor_test.rb
135
+ - test/unit/render_test.rb
136
+ - test/unit/apotomo_test.rb
137
+ - test/unit/javascript_generator_test.rb
138
+ - test/unit/stateful_widget_test.rb
139
+ - test/unit/event_methods_test.rb
140
+ - test/unit/persistence_test.rb
141
+ - test/unit/event_handler_test.rb
142
+ - test/unit/transition_test.rb
143
+ - test/unit/event_test.rb
144
+ - test/unit/widget_test.rb
145
+ - test/unit/widget_shortcuts_test.rb
146
+ - test/unit/test_caching.rb
147
+ - test/unit/test_widget_shortcuts.rb
148
+ - test/unit/test_tab_panel.rb
149
+ - test/unit/test_addressing.rb
150
+ - test/unit/container_test.rb
151
+ - test/unit/test_jump_to_state.rb
152
+ has_rdoc: true
153
+ homepage: http://apotomo.de
154
+ licenses: []
155
+
156
+ post_install_message:
157
+ rdoc_options:
158
+ - --charset=UTF-8
159
+ require_paths:
160
+ - lib
161
+ required_ruby_version: !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ hash: 3
167
+ segments:
168
+ - 0
169
+ version: "0"
170
+ required_rubygems_version: !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ hash: 3
176
+ segments:
177
+ - 0
178
+ version: "0"
179
+ requirements: []
180
+
181
+ rubyforge_project:
182
+ rubygems_version: 1.3.7
183
+ signing_key:
184
+ specification_version: 3
185
+ summary: Event-driven Widgets for Rails with optional Statefulness.
186
+ test_files:
187
+ - test/fixtures/application_widget_tree.rb
188
+ - test/test_helper.rb
189
+ - test/support/test_case_methods.rb
190
+ - test/support/assertions_helper.rb
191
+ - test/rails/rails_integration_test.rb
192
+ - test/rails/view_methods_test.rb
193
+ - test/rails/controller_methods_test.rb
194
+ - test/rails/view_helper_test.rb
195
+ - test/rails/widget_generator_test.rb
196
+ - test/unit/onfire_integration_test.rb
197
+ - test/unit/invoke_test.rb
198
+ - test/unit/request_processor_test.rb
199
+ - test/unit/render_test.rb
200
+ - test/unit/apotomo_test.rb
201
+ - test/unit/javascript_generator_test.rb
202
+ - test/unit/stateful_widget_test.rb
203
+ - test/unit/event_methods_test.rb
204
+ - test/unit/persistence_test.rb
205
+ - test/unit/event_handler_test.rb
206
+ - test/unit/transition_test.rb
207
+ - test/unit/event_test.rb
208
+ - test/unit/widget_test.rb
209
+ - test/unit/widget_shortcuts_test.rb
210
+ - test/unit/test_caching.rb
211
+ - test/unit/test_widget_shortcuts.rb
212
+ - test/unit/test_tab_panel.rb
213
+ - test/unit/test_addressing.rb
214
+ - test/unit/container_test.rb
215
+ - test/unit/test_jump_to_state.rb