active_decorator 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.travis.yml +6 -2
- data/Gemfile +6 -2
- data/active_decorator.gemspec +0 -7
- data/gemfiles/Gemfile-rails.3.0.x +8 -0
- data/gemfiles/Gemfile-rails.3.1.x +8 -0
- data/lib/active_decorator/monkey/action_view/partial_renderer.rb +19 -3
- data/lib/active_decorator/version.rb +1 -1
- metadata +5 -47
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/active_decorator.gemspec
CHANGED
@@ -17,11 +17,4 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
|
-
|
21
|
-
# specify any dependencies here; for example:
|
22
|
-
s.add_development_dependency 'rails'
|
23
|
-
s.add_development_dependency 'rspec-rails'
|
24
|
-
s.add_development_dependency 'capybara'
|
25
|
-
s.add_development_dependency 'sqlite3'
|
26
|
-
# s.add_runtime_dependency "rest-client"
|
27
20
|
end
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
class PartialRenderer
|
3
|
-
def setup_with_decorator(context, options, block)
|
1
|
+
if ActionPack::VERSION::STRING >= '3.1'
|
2
|
+
class ActionView::PartialRenderer
|
3
|
+
def setup_with_decorator(context, options, block) #:nodoc:
|
4
4
|
setup_without_decorator context, options, block
|
5
5
|
|
6
6
|
@locals.values.each do |v|
|
@@ -12,6 +12,22 @@ module ActionView
|
|
12
12
|
self
|
13
13
|
end
|
14
14
|
|
15
|
+
alias_method_chain :setup, :decorator
|
16
|
+
end
|
17
|
+
else
|
18
|
+
class ActionView::Partials::PartialRenderer
|
19
|
+
def setup_with_decorator(options, block) #:nodoc:
|
20
|
+
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
|
29
|
+
end
|
30
|
+
|
15
31
|
alias_method_chain :setup, :decorator
|
16
32
|
end
|
17
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_decorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,52 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: rails
|
16
|
-
requirement: &70226630611740 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :development
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *70226630611740
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: rspec-rails
|
27
|
-
requirement: &70226630609000 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
|
-
requirements:
|
30
|
-
- - ! '>='
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
33
|
-
type: :development
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *70226630609000
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: capybara
|
38
|
-
requirement: &70226630606920 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ! '>='
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '0'
|
44
|
-
type: :development
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *70226630606920
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: sqlite3
|
49
|
-
requirement: &70226630605800 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ! '>='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
|
-
version_requirements: *70226630605800
|
12
|
+
date: 2012-02-27 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
58
14
|
description: A simple and Rubyish view helper for Rails 3
|
59
15
|
email:
|
60
16
|
- ronnie@dio.jp
|
@@ -70,6 +26,8 @@ files:
|
|
70
26
|
- README.md
|
71
27
|
- Rakefile
|
72
28
|
- active_decorator.gemspec
|
29
|
+
- gemfiles/Gemfile-rails.3.0.x
|
30
|
+
- gemfiles/Gemfile-rails.3.1.x
|
73
31
|
- lib/active_decorator.rb
|
74
32
|
- lib/active_decorator/decorator.rb
|
75
33
|
- lib/active_decorator/helpers.rb
|