dapper 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Dapper
|
2
2
|
|
3
|
-
|
3
|
+
Dapper adds the ability to generate presenters for your rails project.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -18,7 +18,27 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
Once the gem is installed, run the presenters generator.
|
22
|
+
|
23
|
+
$ rails generate presenter CONTROLLER_NAME [actions]
|
24
|
+
|
25
|
+
Example:
|
26
|
+
|
27
|
+
$ rails generate presenter Photos index new edit
|
28
|
+
|
29
|
+
The result will be:
|
30
|
+
|
31
|
+
myrailsproject
|
32
|
+
|~app/
|
33
|
+
|~presenters/
|
34
|
+
|~photos/
|
35
|
+
|-edit_presenter.rb
|
36
|
+
|-index_presenter.rb
|
37
|
+
`-new_presenter.rb
|
38
|
+
|
39
|
+
Running the presenter generator without any actions will default to
|
40
|
+
one index_presenter.rb
|
41
|
+
|
22
42
|
|
23
43
|
## Contributing
|
24
44
|
|
data/dapper.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["jeff.carley@gmail.com"]
|
7
7
|
gem.description = %q{A gem for using presenters in your rails application.}
|
8
8
|
gem.summary = %q{Dapper makes it really easy to include presenters into your application. Very handy for cleaning up your views.}
|
9
|
-
gem.homepage = ""
|
9
|
+
gem.homepage = "https://github.com/jcarley/Dapper"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/lib/dapper/version.rb
CHANGED
@@ -3,11 +3,9 @@ class PresenterGenerator < Rails::Generators::NamedBase
|
|
3
3
|
argument :actions, :type => :array, :default => ["index"], :banner => "action action"
|
4
4
|
|
5
5
|
check_class_collision
|
6
|
-
desc "Generate presenter
|
6
|
+
desc "Generate presenter."
|
7
7
|
|
8
8
|
def manifest
|
9
|
-
#template "presenter_helper_template.erb", "app/helpers/presenter_helper.rb"
|
10
|
-
|
11
9
|
actions.each do |action|
|
12
10
|
@action = action
|
13
11
|
template "view_presenter_template.html.erb", "app/presenters/#{file_name}/#{action}_presenter.rb"
|
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.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -30,11 +30,9 @@ 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
33
|
- lib/generators/presenter/presenter_generator.rb
|
35
|
-
- lib/generators/presenter/templates/presenter_helper_template.erb
|
36
34
|
- lib/generators/presenter/templates/view_presenter_template.html.erb
|
37
|
-
homepage:
|
35
|
+
homepage: https://github.com/jcarley/Dapper
|
38
36
|
licenses: []
|
39
37
|
post_install_message:
|
40
38
|
rdoc_options: []
|