dapper 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Dapper
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Explain the generator
3
+
4
+ Example:
5
+ rails generate presenter Thing
6
+
7
+ This will create:
8
+ what/will/it/create
@@ -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
@@ -0,0 +1,7 @@
1
+ module PresenterHelper
2
+
3
+ def initialize_presenter
4
+ klass = "#{controller.controller_name.camelcase}::#{controller.action_name.camelcase}Presenter".constantize
5
+ end
6
+
7
+ end
@@ -0,0 +1,4 @@
1
+ module <%= class_name %>
2
+ class <%= @action.camelize %>Presenter < Dapper::Base
3
+ end
4
+ 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.1
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: