merb-gen 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +14 -2
- data/Rakefile +43 -27
- data/TODO +13 -0
- data/bin/merb-gen +5 -93
- data/lib/generators/controller.rb +44 -0
- data/lib/generators/freezer.rb +19 -0
- data/lib/generators/helper.rb +31 -0
- data/lib/generators/layout.rb +27 -0
- data/lib/generators/merb.rb +24 -0
- data/lib/generators/merb/merb_flat.rb +27 -0
- data/lib/generators/merb/merb_full.rb +35 -0
- data/lib/generators/merb/merb_very_flat.rb +29 -0
- data/lib/generators/merb_plugin.rb +29 -0
- data/lib/generators/migration.rb +54 -0
- data/lib/generators/model.rb +47 -0
- data/lib/generators/part_controller.rb +33 -0
- data/lib/generators/resource.rb +32 -0
- data/lib/generators/resource_controller.rb +78 -0
- data/lib/generators/session_migration.rb +34 -0
- data/lib/generators/templates/application/merb/Rakefile +75 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/app/controllers/application.rb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/app/controllers/exceptions.rb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/app/helpers/global_helpers.rb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/app/views/exceptions/internal_server_error.html.erb +1 -1
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/app/views/exceptions/not_acceptable.html.erb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/app/views/exceptions/not_found.html.erb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/autotest/discover.rb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/autotest/merb.rb +2 -2
- data/lib/generators/templates/application/merb/autotest/merb_rspec.rb +166 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/config/environments/development.rb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/config/environments/production.rb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/config/environments/rake.rb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/config/environments/test.rb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/config/init.rb +38 -27
- data/lib/generators/templates/application/merb/config/rack.rb +12 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/config/router.rb +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/public/images/merb.jpg +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/public/merb.fcgi +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/public/stylesheets/master.css +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/spec/spec.opts +0 -0
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/spec/spec_helper.rb +3 -1
- data/{app_generators/merb/templates → lib/generators/templates/application/merb}/test/test_helper.rb +0 -0
- data/{app_generators/merb_flat/templates → lib/generators/templates/application/merb_flat}/README.txt +0 -0
- data/{app_generators/merb_flat/templates → lib/generators/templates/application/merb_flat}/application.rb +0 -0
- data/lib/generators/templates/application/merb_flat/config/framework.rb +7 -0
- data/{app_generators/merb_flat/templates → lib/generators/templates/application/merb_flat}/config/init.rb +0 -1
- data/{app_generators/merb_flat/templates → lib/generators/templates/application/merb_flat}/views/foo.html.erb +0 -0
- data/{app_generators/merb_plugin/templates → lib/generators/templates/application/merb_plugin}/LICENSE +0 -0
- data/{app_generators/merb_plugin/templates → lib/generators/templates/application/merb_plugin}/README +0 -0
- data/lib/generators/templates/application/merb_plugin/Rakefile +59 -0
- data/{app_generators/merb_plugin/templates → lib/generators/templates/application/merb_plugin}/TODO +0 -0
- data/{app_generators/merb_plugin/templates → lib/generators/templates/application/merb_plugin}/lib/%base_name%.rb +1 -1
- data/{app_generators/merb_plugin/templates → lib/generators/templates/application/merb_plugin}/lib/%base_name%/merbtasks.rb +1 -1
- data/{app_generators/merb_plugin/templates → lib/generators/templates/application/merb_plugin}/spec/%base_name%_spec.rb +0 -0
- data/{app_generators/merb_plugin/templates → lib/generators/templates/application/merb_plugin}/spec/spec_helper.rb +0 -0
- data/{app_generators/merb_plugin/templates → lib/generators/templates/application/merb_plugin}/test/%base_name%_test.rb +0 -0
- data/{app_generators/merb_plugin/templates → lib/generators/templates/application/merb_plugin}/test/test_helper.rb +0 -0
- data/lib/generators/templates/application/merb_very_flat/application.rbt +17 -0
- data/lib/generators/templates/component/controller/app/controllers/%file_name%.rb +11 -0
- data/lib/generators/templates/component/controller/app/views/%file_name%/index.html.erb +1 -0
- data/lib/generators/templates/component/controller/spec/controllers/%file_name%_spec.rb +7 -0
- data/lib/generators/templates/component/controller/test/controllers/%file_name%_test.rb +17 -0
- data/lib/generators/templates/component/freezer/script/frozen_merb +43 -0
- data/lib/generators/templates/component/helper/app/helpers/%file_name%_helper.rb +7 -0
- data/lib/generators/templates/component/helper/spec/helpers/%file_name%_helper_spec.rb +5 -0
- data/{app_generators/merb/templates/app/views/layout/application.html.erb → lib/generators/templates/component/layout/app/views/layout/%file_name%.html.erb} +0 -0
- data/lib/generators/templates/component/layout/spec/views/layout/%file_name%.html.erb_spec.rb +1 -0
- data/lib/generators/templates/component/model/app/models/%file_name%.rb +7 -0
- data/lib/generators/templates/component/model/spec/models/%file_name%_spec.rb +7 -0
- data/lib/generators/templates/component/model/test/models/%file_name%_test.rb +9 -0
- data/lib/generators/templates/component/part_controller/app/parts/%file_name%_part.rb +9 -0
- data/lib/generators/templates/component/part_controller/app/parts/views/%file_name%_part/index.html.erb +3 -0
- data/lib/generators/templates/component/resource_controller/app/controllers/%file_name%.rb +44 -0
- data/lib/generators/templates/component/resource_controller/app/views/%file_name%/edit.html.erb +3 -0
- data/lib/generators/templates/component/resource_controller/app/views/%file_name%/index.html.erb +3 -0
- data/lib/generators/templates/component/resource_controller/app/views/%file_name%/new.html.erb +3 -0
- data/lib/generators/templates/component/resource_controller/app/views/%file_name%/show.html.erb +3 -0
- data/lib/generators/templates/component/resource_controller/spec/controllers/%file_name%_spec.rb +7 -0
- data/lib/generators/templates/component/resource_controller/test/controllers/%file_name%_test.rb +17 -0
- data/lib/merb-gen.rb +34 -36
- data/lib/merb-gen/generator.rb +54 -0
- data/lib/merb-gen/named_generator.rb +33 -0
- data/lib/merb-gen/namespaced_generator.rb +47 -0
- data/lib/merb-gen/spec_helper.rb +65 -0
- data/spec/controller_spec.rb +106 -0
- data/spec/fixtures/results/no_modules.test +1 -0
- data/spec/fixtures/results/some_modules.test +5 -0
- data/spec/fixtures/templates/no_modules.test +3 -0
- data/spec/fixtures/templates/some_modules.test +3 -0
- data/spec/freezer_spec.rb +17 -0
- data/spec/generator_spec.rb +51 -0
- data/spec/helper_spec.rb +43 -0
- data/spec/layout_spec.rb +25 -0
- data/spec/merb_flat_spec.rb +21 -0
- data/spec/merb_full_spec.rb +31 -0
- data/spec/merb_plugin_spec.rb +21 -0
- data/spec/merb_spec.rb +20 -0
- data/spec/merb_very_flat_spec.rb +19 -0
- data/spec/migration_spec.rb +47 -0
- data/spec/model_spec.rb +66 -0
- data/spec/named_generator_spec.rb +11 -0
- data/spec/namespaced_generator_spec.rb +11 -0
- data/spec/part_controller_spec.rb +74 -0
- data/spec/resource_controller_spec.rb +102 -0
- data/spec/resource_spec.rb +18 -0
- data/spec/session_migration_spec.rb +15 -0
- data/spec/spec_helper.rb +271 -0
- metadata +246 -181
- data/app_generators/merb/USAGE +0 -0
- data/app_generators/merb/merb_generator.rb +0 -40
- data/app_generators/merb/templates/Rakefile +0 -34
- data/app_generators/merb/templates/autotest/merb_rspec.rb +0 -223
- data/app_generators/merb/templates/config/rack.rb +0 -1
- data/app_generators/merb_flat/merb_flat_generator.rb +0 -22
- data/app_generators/merb_flat/templates/config/framework.rb +0 -5
- data/app_generators/merb_plugin/merb_plugin_generator.rb +0 -22
- data/app_generators/merb_plugin/templates/Rakefile +0 -44
- data/app_generators/merb_very_flat/merb_very_flat_generator.rb +0 -37
- data/app_generators/merb_very_flat/templates/%app_file_name%.rb +0 -15
- data/app_generators/merb_very_flat/templates/README.txt +0 -9
- data/lib/merb-gen/base.rb +0 -66
- data/lib/merb-gen/helpers.rb +0 -108
- data/merb_default_generators/model/USAGE +0 -0
- data/merb_default_generators/model/model_generator.rb +0 -40
- data/merb_default_generators/model/templates/app/models/%model_file_name%.rb +0 -5
- data/merb_default_generators/resource_controller/USAGE +0 -0
- data/merb_default_generators/resource_controller/resource_controller_generator.rb +0 -74
- data/merb_default_generators/resource_controller/templates/app/controllers/%controller_file_name%.rb +0 -46
- data/merb_default_generators/resource_controller/templates/app/helpers/%controller_file_name%_helper.rb +0 -16
- data/merb_default_generators/resource_controller/templates/app/views/%controller_file_name%/delete.html.erb +0 -3
- data/merb_default_generators/resource_controller/templates/app/views/%controller_file_name%/edit.html.erb +0 -3
- data/merb_default_generators/resource_controller/templates/app/views/%controller_file_name%/index.html.erb +0 -3
- data/merb_default_generators/resource_controller/templates/app/views/%controller_file_name%/new.html.erb +0 -3
- data/merb_default_generators/resource_controller/templates/app/views/%controller_file_name%/show.html.erb +0 -3
- data/merb_generators/controller/USAGE +0 -0
- data/merb_generators/controller/controller_generator.rb +0 -59
- data/merb_generators/controller/templates/app/controllers/%controller_file_name%.rb +0 -18
- data/merb_generators/controller/templates/app/helpers/%controller_file_name%_helper.rb +0 -16
- data/merb_generators/controller/templates/app/views/%controller_file_name%/index.html.erb +0 -1
- data/merb_generators/part_controller/USAGE +0 -0
- data/merb_generators/part_controller/part_controller_generator.rb +0 -58
- data/merb_generators/part_controller/templates/app/helpers/%controller_file_name%_part_helper.rb +0 -16
- data/merb_generators/part_controller/templates/app/parts/%controller_file_name%_part.rb +0 -18
- data/merb_generators/part_controller/templates/app/parts/views/%controller_file_name%_part/index.html.erb +0 -3
- data/merb_generators/resource/USAGE +0 -0
- data/merb_generators/resource/resource_generator.rb +0 -48
- data/rspec_generators/merb_controller_test/merb_controller_test_generator.rb +0 -49
- data/rspec_generators/merb_controller_test/templates/spec/controllers/%controller_full_file_path%_spec.rb +0 -7
- data/rspec_generators/merb_controller_test/templates/spec/helpers/%controller_full_file_path%_helper_spec.rb +0 -5
- data/rspec_generators/merb_model_test/merb_model_test_generator.rb +0 -35
- data/rspec_generators/merb_model_test/templates/spec/models/%model_file_name%_spec.rb +0 -7
- data/rspec_generators/merb_resource_controller_test/merb_resource_controller_test_generator.rb +0 -49
- data/rspec_generators/merb_resource_controller_test/templates/spec/controllers/%controller_full_file_path%_spec.rb +0 -7
- data/rspec_generators/merb_resource_controller_test/templates/spec/helpers/%controller_full_file_path%_helpers.rb +0 -5
- data/rspec_generators/merb_resource_controller_test/templates/spec/views/%controller_full_file_path%/delete.html.erb_spec.rb +0 -1
- data/rspec_generators/merb_resource_controller_test/templates/spec/views/%controller_full_file_path%/edit.html.erb_spec.rb +0 -1
- data/rspec_generators/merb_resource_controller_test/templates/spec/views/%controller_full_file_path%/index.html.erb_spec.rb +0 -1
- data/rspec_generators/merb_resource_controller_test/templates/spec/views/%controller_full_file_path%/new.html.erb_spec.rb +0 -1
- data/rspec_generators/merb_resource_controller_test/templates/spec/views/%controller_full_file_path%/show.html.erb_spec.rb +0 -1
- data/test_unit_generators/merb_controller_test/merb_controller_test_generator.rb +0 -47
- data/test_unit_generators/merb_controller_test/templates/test/functional/%controller_full_file_path%_test.rb +0 -17
- data/test_unit_generators/merb_model_test/merb_model_test_generator.rb +0 -34
- data/test_unit_generators/merb_model_test/templates/test/unit/%model_file_name%_test.rb +0 -9
- data/test_unit_generators/merb_resource_controller_test/merb_resource_controller_test_generator.rb +0 -31
@@ -1,34 +0,0 @@
|
|
1
|
-
class MerbModelTestGenerator < Merb::GeneratorBase
|
2
|
-
attr_reader :model_attributes, :model_class_name, :model_file_name
|
3
|
-
|
4
|
-
def initialize(args, runtime_args = {})
|
5
|
-
@base = File.dirname(__FILE__)
|
6
|
-
super
|
7
|
-
@model_file_name = runtime_args[:model_file_name]
|
8
|
-
@model_attributes = runtime_args[:model_attributes]
|
9
|
-
@model_class_name = runtime_args[:model_class_name]
|
10
|
-
|
11
|
-
end
|
12
|
-
|
13
|
-
def manifest
|
14
|
-
record do |m|
|
15
|
-
@m = m
|
16
|
-
|
17
|
-
@assigns = { :model_file_name => model_file_name,
|
18
|
-
:model_attributes => model_attributes,
|
19
|
-
:model_class_name => model_class_name
|
20
|
-
}
|
21
|
-
copy_dirs
|
22
|
-
copy_files
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
protected
|
27
|
-
def banner
|
28
|
-
<<-EOS.split("\n").map{|x| x.strip}.join("\n")
|
29
|
-
Creates a basic Test::Unit unit test stub.
|
30
|
-
|
31
|
-
USAGE: #{spec.name}"
|
32
|
-
EOS
|
33
|
-
end
|
34
|
-
end
|
data/test_unit_generators/merb_resource_controller_test/merb_resource_controller_test_generator.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
class MerbResourceControllerTestGenerator < Merb::GeneratorBase
|
2
|
-
attr_reader :controller_modules,
|
3
|
-
:controller_class_name,
|
4
|
-
:controller_file_name,
|
5
|
-
:controller_base_path,
|
6
|
-
:full_controller_const
|
7
|
-
|
8
|
-
def initialize(args, runtime_args = {})
|
9
|
-
@base = File.dirname(__FILE__)
|
10
|
-
super
|
11
|
-
@args = args
|
12
|
-
@runtime_args = runtime_args
|
13
|
-
end
|
14
|
-
|
15
|
-
def manifest
|
16
|
-
record do |m|
|
17
|
-
@m = m
|
18
|
-
|
19
|
-
m.dependency "merb_controller_test", @args, @runtime_args
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
protected
|
24
|
-
def banner
|
25
|
-
<<-EOS.split("\n").map{|x| x.strip}.join("\n")
|
26
|
-
Creates a basic Test::Unit Functional test stub.
|
27
|
-
|
28
|
-
USAGE: #{spec.name}"
|
29
|
-
EOS
|
30
|
-
end
|
31
|
-
end
|