apotomo 0.1.4 → 1.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -2
- data/Gemfile.lock +70 -21
- data/Rakefile +7 -7
- data/config/routes.rb +3 -3
- data/lib/apotomo/persistence.rb +21 -48
- data/lib/apotomo/rails/view_helper.rb +3 -11
- data/lib/apotomo/request_processor.rb +7 -10
- data/lib/apotomo/transition.rb +2 -2
- data/lib/apotomo/version.rb +1 -1
- data/lib/apotomo/widget.rb +12 -25
- data/lib/apotomo/widget_shortcuts.rb +1 -1
- data/lib/apotomo.rb +6 -0
- data/{generators/widget → lib/generators/apotomo}/USAGE +0 -0
- data/lib/generators/apotomo/templates/view.erb +7 -0
- data/lib/generators/apotomo/templates/view.haml +4 -0
- data/{generators/widget → lib/generators/apotomo}/templates/widget.rb +2 -1
- data/lib/generators/apotomo/templates/widget_test.rb +11 -0
- data/lib/generators/apotomo/widget_generator.rb +19 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/config/application.rb +45 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +26 -0
- data/test/dummy/config/environments/production.rb +49 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/routes.rb +59 -0
- data/test/dummy/tmp/app/cells/mouse_widget.rb +11 -0
- data/test/dummy/tmp/test/widgets/mouse_widget_test.rb +15 -0
- data/test/rails/controller_methods_test.rb +11 -14
- data/test/rails/rails_integration_test.rb +12 -11
- data/test/rails/view_helper_test.rb +4 -27
- data/test/rails/view_methods_test.rb +4 -6
- data/test/rails/widget_generator_test.rb +40 -37
- data/test/support/test_case_methods.rb +34 -7
- data/test/test_helper.rb +12 -24
- data/test/unit/container_test.rb +2 -1
- data/test/unit/event_handler_test.rb +2 -0
- data/test/unit/event_methods_test.rb +4 -3
- data/test/unit/invoke_test.rb +27 -22
- data/test/unit/onfire_integration_test.rb +2 -0
- data/test/unit/persistence_test.rb +51 -90
- data/test/unit/render_test.rb +6 -4
- data/test/unit/request_processor_test.rb +70 -48
- data/test/unit/stateful_widget_test.rb +3 -1
- data/test/unit/transition_test.rb +1 -0
- data/test/unit/widget_shortcuts_test.rb +3 -2
- data/test/unit/widget_test.rb +69 -56
- metadata +57 -34
- data/app/.jeweler_doesnt_like_empty_directories +0 -0
- data/generators/widget/templates/functional_test.rb +0 -8
- data/generators/widget/templates/view.html.erb +0 -2
- data/generators/widget/templates/view.html.haml +0 -3
- data/generators/widget/widget_generator.rb +0 -34
- data/lib/apotomo/test_methods.rb +0 -8
- data/test/support/assertions_helper.rb +0 -13
- data/test/unit/test_methods_test.rb +0 -11
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'rails_generator/generators/components/controller/controller_generator'
|
2
|
-
|
3
|
-
class WidgetGenerator < ControllerGenerator
|
4
|
-
def add_options!(opt)
|
5
|
-
opt.on('--haml') { |value| options[:view_format] = 'haml' }
|
6
|
-
end
|
7
|
-
|
8
|
-
def manifest
|
9
|
-
options.reverse_merge! :view_format => 'erb'
|
10
|
-
|
11
|
-
record do |m|
|
12
|
-
# Check for class naming collisions.
|
13
|
-
m.class_collisions class_path, "#{class_name}"
|
14
|
-
|
15
|
-
# Directories
|
16
|
-
m.directory File.join('app/cells', class_path)
|
17
|
-
m.directory File.join('app/cells', class_path, file_name)
|
18
|
-
m.directory File.join('test/widgets')
|
19
|
-
|
20
|
-
# Widget
|
21
|
-
m.template 'widget.rb', File.join('app/cells', class_path, "#{file_name}.rb")
|
22
|
-
|
23
|
-
# View template for each state.
|
24
|
-
format = options[:view_format]
|
25
|
-
actions.each do |state|
|
26
|
-
path = File.join('app/cells', class_path, file_name, "#{state}.html.#{format}")
|
27
|
-
m.template "view.html.#{format}", path, :assigns => { :action => state, :path => path }
|
28
|
-
end
|
29
|
-
|
30
|
-
# Functional test for the widget.
|
31
|
-
m.template 'functional_test.rb', File.join('test/widgets/', "#{file_name}_test.rb"), :assigns => {:states => actions}
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
data/lib/apotomo/test_methods.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
require 'apotomo/test_methods'
|
3
|
-
|
4
|
-
class TestMethodsTest < Test::Unit::TestCase
|
5
|
-
include Apotomo::TestMethods
|
6
|
-
context "A Unit test with included module" do
|
7
|
-
should "provide #render_widget" do
|
8
|
-
assert_respond_to self, :render_widget
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|