active_decorator_with_decorate_associations 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ce61e6f92676a60254a628b4b650408d787919c
4
- data.tar.gz: 291311be7e2253161cb68d0d9eb10d1bc9eb529b
3
+ metadata.gz: 637a12419320e2680e0faa087bfd841397cee7ae
4
+ data.tar.gz: 37dd361d22fb974839bf73b44d3d87b7e4f7a5b4
5
5
  SHA512:
6
- metadata.gz: 8f7299b4c67f0f0df6ed6e74e814f3a9758fcf2020d20745300d9dd7a6331d21caa367af084f7fe06a68f7bfafbe04474c13afb5987969d70fb3b3431d862c81
7
- data.tar.gz: fae9cbc2a55fc689e53238823b3f974e7e80427ea6cf8a713e458e76d594b83cd1297297e59d25c35769769c235be85cc8bf97b04046b600d68850219cfcf1c8
6
+ metadata.gz: 1795ab7f39e144adb5f5ac558513d5fa1cafad231beadd2e83ff0b51c3746df3ba07900b60e724d31d46a5a06d40af9b64546097bc53424e170c7f0d4b1ce963
7
+ data.tar.gz: db042cf412f6dc4e6aefc24649435ad6f6f47d1c1a9374bb416f233688cf1cbdfbbd553b0ed53b2a8e5c73db0c897ad13ca07e8856584d09ad6a879acaac945e
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /gemfiles/*.lock
@@ -8,5 +8,23 @@ rvm:
8
8
  - 2.2.4
9
9
  - 2.3.0
10
10
  - ruby-head
11
+ gemfile:
12
+ - gemfiles/Gemfile-rails.3.2.x
13
+ - gemfiles/Gemfile-rails.4.0.x
14
+ - gemfiles/Gemfile-rails.4.1.x
15
+ - gemfiles/Gemfile-rails.4.2.x
16
+ - gemfiles/Gemfile-rails.5.0.0.beta3
11
17
 
12
18
  sudo: false
19
+
20
+ matrix:
21
+ exclude:
22
+ - rvm: ruby-head
23
+ gemfile: gemfiles/Gemfile-rails.3.2.x
24
+ - rvm: 2.0.0
25
+ gemfile: gemfiles/Gemfile-rails.5.0.0.beta3
26
+ - rvm: 2.1.8
27
+ gemfile: gemfiles/Gemfile-rails.5.0.0.beta3
28
+ allow_failures:
29
+ - rvm: ruby-head
30
+ - gemfile: gemfiles/Gemfile-rails.5.0.0.beta3
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- # ActiveDecoratorWithDecorateAssociations
1
+ # ActiveDecoratorWithDecorateAssociations [![Build Status](https://travis-ci.org/itkrt2y/active_decorator_with_decorate_associations.svg?branch=master)](https://travis-ci.org/itkrt2y/active_decorator_with_decorate_associations)
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/active_decorator_with_decorate_associations`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Enable active_decorator to automatically decorate associated models
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,20 +20,13 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
23
+ See active_decorator
24
+ https://github.com/amatsuda/active_decorator
32
25
 
33
26
  ## Contributing
34
27
 
35
28
  Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/active_decorator_with_decorate_associations.
36
29
 
37
-
38
30
  ## License
39
31
 
40
32
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
@@ -21,5 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency "rails", ">= 3.2"
22
22
  spec.add_development_dependency "bundler", "~> 1.11"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
- spec.add_development_dependency "minitest", "~> 5.0"
24
+ spec.add_development_dependency "test-unit-rails"
25
+ spec.add_development_dependency "capybara"
26
+ spec.add_development_dependency "sqlite3"
27
+ spec.add_development_dependency "jbuilder", ">= 2.3.1"
25
28
  end
@@ -0,0 +1,20 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'active_decorator_with_decorate_associations', path: '..'
4
+
5
+ gem 'rails', '~> 3.2.0'
6
+ gem 'test-unit-rails', '1.0.2'
7
+ if RUBY_VERSION <= '1.8.7'
8
+ gem 'i18n', '~> 0.6.11'
9
+ end
10
+ gem 'capybara', '~> 2.0.0'
11
+ # rubyzip >=1 doesn't support ruby 1.8
12
+ gem 'rubyzip', '< 1.0.0'
13
+ gem 'sqlite3'
14
+ gem 'nokogiri', '~> 1.5.0'
15
+ if RUBY_VERSION <= '1.8.7'
16
+ gem 'jbuilder', '< 2'
17
+ else
18
+ gem 'jbuilder'
19
+ end
20
+ gem 'test-unit'
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'active_decorator_with_decorate_associations', path: '..'
4
+
5
+ gem 'rails', '~> 4.0.0'
6
+ gem 'test-unit-rails'
7
+ gem 'capybara'
8
+ gem 'sqlite3'
9
+ gem 'jbuilder'
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'active_decorator_with_decorate_associations', path: '..'
4
+
5
+ gem 'rails', '~> 4.1.0'
6
+ gem 'test-unit-rails'
7
+ gem 'capybara'
8
+ gem 'sqlite3'
9
+ gem 'jbuilder'
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'active_decorator_with_decorate_associations', path: '..'
4
+
5
+ gem 'rails', '~> 4.2.0'
6
+ gem 'test-unit-rails'
7
+ gem 'capybara'
8
+ gem 'sqlite3'
9
+ gem 'jbuilder'
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'active_decorator_with_decorate_associations', path: '..'
4
+
5
+ gem 'rails', '~> 5.0.0.beta3'
6
+ gem 'test-unit-rails'
7
+ gem 'capybara'
8
+ gem 'sqlite3'
9
+ gem 'jbuilder'
@@ -2,11 +2,16 @@
2
2
  # https://github.com/amatsuda/active_decorator/pull/15
3
3
  # https://github.com/amatsuda/active_decorator/pull/59
4
4
 
5
+ require "active_decorator_with_decorate_associations/marker"
6
+
5
7
  module ActiveDecoratorExtension
6
8
  def decorate(obj)
7
9
  return if defined?(Jbuilder) && Jbuilder === obj
8
10
  return if obj.nil?
11
+
9
12
  super
13
+
14
+ obj.extend ActiveDecoratorWithDecorateAssociations::Marker if obj.is_a?(ActiveRecord::Base)
10
15
  obj
11
16
  end
12
17
  end
@@ -1,11 +1,12 @@
1
1
  require "active_decorator"
2
+ require "active_decorator_with_decorate_associations/marker"
2
3
 
3
4
  module ActiveDecoratorWithDecorateAssociations
4
5
  class Decorator
5
6
  include Singleton
6
7
 
7
8
  def decorate(owner, target)
8
- if owner.is_a?(ActiveDecorator::Helpers)
9
+ if owner.is_a?(ActiveDecoratorWithDecorateAssociations::Marker)
9
10
  ActiveDecorator::Decorator.instance.decorate(target)
10
11
  else
11
12
  target
@@ -0,0 +1,4 @@
1
+ module ActiveDecoratorWithDecorateAssociations
2
+ module Marker
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module ActiveDecoratorWithDecorateAssociations
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_decorator_with_decorate_associations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuya Itakura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_decorator
@@ -67,19 +67,61 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '10.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: minitest
70
+ name: test-unit-rails
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '5.0'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: capybara
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sqlite3
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: jbuilder
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: 2.3.1
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
81
123
  - !ruby/object:Gem::Version
82
- version: '5.0'
124
+ version: 2.3.1
83
125
  description: Enable active_decorator to automatically decorate associated models
84
126
  email: itkrt2y.591721200@gmail.com
85
127
  executables: []
@@ -95,11 +137,17 @@ files:
95
137
  - active_decorator_with_decorate_associations.gemspec
96
138
  - bin/console
97
139
  - bin/setup
140
+ - gemfiles/Gemfile-rails.3.2.x
141
+ - gemfiles/Gemfile-rails.4.0.x
142
+ - gemfiles/Gemfile-rails.4.1.x
143
+ - gemfiles/Gemfile-rails.4.2.x
144
+ - gemfiles/Gemfile-rails.5.0.0.beta3
98
145
  - lib/active_decorator_with_decorate_associations.rb
99
146
  - lib/active_decorator_with_decorate_associations/active_decorator_extension.rb
100
147
  - lib/active_decorator_with_decorate_associations/association_decorator.rb
101
148
  - lib/active_decorator_with_decorate_associations/collection_association_decorator.rb
102
149
  - lib/active_decorator_with_decorate_associations/decorator.rb
150
+ - lib/active_decorator_with_decorate_associations/marker.rb
103
151
  - lib/active_decorator_with_decorate_associations/railtie.rb
104
152
  - lib/active_decorator_with_decorate_associations/version.rb
105
153
  homepage: https://github.com/itkrt2y/active_decorator_with_decorate_associations
@@ -122,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
170
  version: '0'
123
171
  requirements: []
124
172
  rubyforge_project:
125
- rubygems_version: 2.2.5
173
+ rubygems_version: 2.6.3
126
174
  signing_key:
127
175
  specification_version: 4
128
176
  summary: active_decorator extension to decorate associated models