active_decorator 0.3.0 → 0.3.1

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/.gitignore CHANGED
@@ -1,5 +1,7 @@
1
1
  *.gem
2
2
  .bundle
3
3
  Gemfile.lock
4
+ gemfiles/Gemfile-rails.3.0.x.lock
5
+ gemfiles/Gemfile-rails.3.1.x.lock
4
6
  pkg/*
5
7
  log
data/.travis.yml CHANGED
@@ -1,6 +1,10 @@
1
+ language: ruby
2
+ script: bundle exec rake spec
1
3
  rvm:
2
4
  - 1.8.7
3
5
  - 1.9.3
4
6
  - ruby-head
5
-
6
- script: bundle exec rake spec
7
+ gemfile:
8
+ - gemfiles/Gemfile-rails.3.0.x
9
+ - gemfiles/Gemfile-rails.3.1.x
10
+ - Gemfile
data/Gemfile CHANGED
@@ -1,4 +1,8 @@
1
- source "http://rubygems.org"
1
+ source :rubygems
2
2
 
3
- # Specify your gem's dependencies in active_decorator.gemspec
4
3
  gemspec
4
+
5
+ gem 'rails', '~> 3.2.0'
6
+ gem 'rspec-rails'
7
+ gem 'capybara'
8
+ gem 'sqlite3'
@@ -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
@@ -0,0 +1,8 @@
1
+ source :rubygems
2
+
3
+ gem 'active_decorator', :path => '..'
4
+
5
+ gem 'rails', '~> 3.0.0'
6
+ gem 'rspec-rails'
7
+ gem 'capybara'
8
+ gem 'sqlite3'
@@ -0,0 +1,8 @@
1
+ source :rubygems
2
+
3
+ gem 'active_decorator', :path => '..'
4
+
5
+ gem 'rails', '~> 3.1.0'
6
+ gem 'rspec-rails'
7
+ gem 'capybara'
8
+ gem 'sqlite3'
@@ -1,6 +1,6 @@
1
- module ActionView
2
- class PartialRenderer < AbstractRenderer #:nodoc:
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
@@ -1,3 +1,3 @@
1
1
  module ActiveDecorator
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  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.0
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-26 00:00:00.000000000 Z
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