dapper 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dapper/version.rb +1 -1
- data/lib/generators/presenter/USAGE +8 -0
- data/lib/generators/presenter/presenter_generator.rb +16 -0
- data/lib/generators/presenter/templates/presenter_helper_template.erb +7 -0
- data/lib/generators/presenter/templates/view_presenter_template.html.erb +4 -0
- metadata +5 -1
data/lib/dapper/version.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
class PresenterGenerator < Rails::Generators::NamedBase
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
argument :actions, :type => :array, :default => ["index"], :banner => "action action"
|
4
|
+
|
5
|
+
check_class_collision
|
6
|
+
desc "Generate presenter and supporting files"
|
7
|
+
|
8
|
+
def manifest
|
9
|
+
#template "presenter_helper_template.erb", "app/helpers/presenter_helper.rb"
|
10
|
+
|
11
|
+
actions.each do |action|
|
12
|
+
@action = action
|
13
|
+
template "view_presenter_template.html.erb", "app/presenters/#{file_name}/#{action}_presenter.rb"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -30,6 +30,10 @@ files:
|
|
30
30
|
- lib/dapper/system.rb
|
31
31
|
- lib/dapper/version.rb
|
32
32
|
- lib/dapper/view_context.rb
|
33
|
+
- lib/generators/presenter/USAGE
|
34
|
+
- lib/generators/presenter/presenter_generator.rb
|
35
|
+
- lib/generators/presenter/templates/presenter_helper_template.erb
|
36
|
+
- lib/generators/presenter/templates/view_presenter_template.html.erb
|
33
37
|
homepage: ''
|
34
38
|
licenses: []
|
35
39
|
post_install_message:
|