active_decorator 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -1
- data/lib/active_decorator/decorator.rb +2 -1
- data/lib/active_decorator/monkey/action_view/partial_renderer.rb +20 -16
- data/lib/active_decorator/version.rb +1 -1
- data/lib/generators/rails/decorator_generator.rb +0 -2
- data/lib/generators/rspec/decorator_generator.rb +0 -2
- data/lib/generators/test_unit/decorator_generator.rb +0 -2
- metadata +39 -20
data/README.md
CHANGED
@@ -1,31 +1,35 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
def
|
4
|
-
setup_without_decorator context, options, block
|
5
|
-
|
1
|
+
module ActiveDecorator
|
2
|
+
module ActionViewExtension
|
3
|
+
def setup_decorator
|
6
4
|
@locals.values.each do |v|
|
7
5
|
ActiveDecorator::Decorator.instance.decorate v
|
8
|
-
end
|
9
|
-
ActiveDecorator::Decorator.instance.decorate @object
|
10
|
-
ActiveDecorator::Decorator.instance.decorate @collection
|
6
|
+
end unless @locals.blank?
|
7
|
+
ActiveDecorator::Decorator.instance.decorate @object unless @object.blank?
|
8
|
+
ActiveDecorator::Decorator.instance.decorate @collection unless @collection.blank?
|
11
9
|
|
12
10
|
self
|
13
11
|
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
if ActionPack::VERSION::STRING >= '3.1'
|
16
|
+
class ActionView::PartialRenderer
|
17
|
+
include ActiveDecorator::ActionViewExtension
|
18
|
+
|
19
|
+
def setup_with_decorator(context, options, block) #:nodoc:
|
20
|
+
setup_without_decorator context, options, block
|
21
|
+
setup_decorator
|
22
|
+
end
|
14
23
|
|
15
24
|
alias_method_chain :setup, :decorator
|
16
25
|
end
|
17
26
|
else
|
18
27
|
class ActionView::Partials::PartialRenderer
|
28
|
+
include ActiveDecorator::ActionViewExtension
|
29
|
+
|
19
30
|
def setup_with_decorator(options, block) #:nodoc:
|
20
31
|
setup_without_decorator options, block
|
21
|
-
|
22
|
-
@locals.values.each do |v|
|
23
|
-
ActiveDecorator::Decorator.instance.decorate v
|
24
|
-
end if @locals.present?
|
25
|
-
ActiveDecorator::Decorator.instance.decorate @object if @object.present?
|
26
|
-
ActiveDecorator::Decorator.instance.decorate @collection if @collection.present?
|
27
|
-
|
28
|
-
self
|
32
|
+
setup_decorator
|
29
33
|
end
|
30
34
|
|
31
35
|
alias_method_chain :setup, :decorator
|
metadata
CHANGED
@@ -1,23 +1,33 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_decorator
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 2
|
10
|
+
version: 0.3.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Akira Matsuda
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
17
|
+
|
18
|
+
date: 2012-04-02 00:00:00 Z
|
13
19
|
dependencies: []
|
20
|
+
|
14
21
|
description: A simple and Rubyish view helper for Rails 3
|
15
|
-
email:
|
22
|
+
email:
|
16
23
|
- ronnie@dio.jp
|
17
24
|
executables: []
|
25
|
+
|
18
26
|
extensions: []
|
27
|
+
|
19
28
|
extra_rdoc_files: []
|
20
|
-
|
29
|
+
|
30
|
+
files:
|
21
31
|
- .gitignore
|
22
32
|
- .rspec
|
23
33
|
- .travis.yml
|
@@ -54,29 +64,38 @@ files:
|
|
54
64
|
- spec/spec_helper.rb
|
55
65
|
homepage: https://github.com/amatsuda/active_decorator
|
56
66
|
licenses: []
|
67
|
+
|
57
68
|
post_install_message:
|
58
69
|
rdoc_options: []
|
59
|
-
|
70
|
+
|
71
|
+
require_paths:
|
60
72
|
- lib
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
74
|
none: false
|
63
|
-
requirements:
|
64
|
-
- -
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
|
67
|
-
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
hash: 3
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
version: "0"
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
83
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
88
|
+
segments:
|
89
|
+
- 0
|
90
|
+
version: "0"
|
73
91
|
requirements: []
|
92
|
+
|
74
93
|
rubyforge_project: active_decorator
|
75
|
-
rubygems_version: 1.8.
|
94
|
+
rubygems_version: 1.8.10
|
76
95
|
signing_key:
|
77
96
|
specification_version: 3
|
78
97
|
summary: A simple and Rubyish view helper for Rails 3
|
79
|
-
test_files:
|
98
|
+
test_files:
|
80
99
|
- spec/fake_app/authors/index.html.erb
|
81
100
|
- spec/fake_app/authors/show.html.erb
|
82
101
|
- spec/fake_app/books/_book.html.erb
|