dao-gateway-active_resource 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b177bf24454de496c068100e9fec858c2b44ef8
4
- data.tar.gz: 061c7e8b2d85b8077a6efa5ea50358526f0e2e6f
3
+ metadata.gz: 009d64b19fabf9d073230a4203c9c8bc00704108
4
+ data.tar.gz: 747bfd831530458d0a23aebd12a8e192355dcc87
5
5
  SHA512:
6
- metadata.gz: 7b78ae37a1497957adf07d02f146a29cecbd8b09929cd0bb307ab1d4f1a889ca34caba9f93e6df8d95c768f2f7623cbb4762b33eaadf4b84b1a45a767f9cc37a
7
- data.tar.gz: 5b958ceca6a20b744574babe225736edd33affb7c442d5e167df4f46b6cad665d6e7f32edd2f16a245a53fd609bd2459b9a990addfc3c3dce3f199b48e003ed2
6
+ metadata.gz: f0b1e990345cb01ba3d4316ec53d6a6c9916cbdc18d8194429832b5b5f8c98b6de18906d6a1eba68c1a658f03548b81ef21130c9a355f550e5ceb6e190e0fd4a
7
+ data.tar.gz: 1336db860d01f50a01c4ceb98d656d26d919fbeaec0be0f9f577c66be3cc7dbbe4c6d4d1330c55f5c8adac22b69f0077a1f5bd890274cb38c21c7ba4dcdf7271
data/.travis.yml CHANGED
@@ -2,3 +2,5 @@ language: ruby
2
2
  rvm:
3
3
  - 2.3.0
4
4
  before_install: gem install bundler -v 1.11.2
5
+ script:
6
+ - CODECLIMATE_REPO_TOKEN=d5d64405f6f096cac7bf060b04986c7d01228257d187d02a9cb0a7935b61679c bundle exec rspec
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Dao::Gateway::ActiveResource
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/dao-gateway-active_resource.svg)](https://badge.fury.io/rb/dao-gateway-active_resource)
3
4
  [![Build Status](https://travis-ci.org/dao-rb/dao-gateway-active_resource.svg?branch=master)](https://travis-ci.org/dao-rb/dao-gateway-active_resource)
4
5
  [![Code Climate](https://codeclimate.com/github/dao-rb/dao-gateway-active_resource/badges/gpa.svg)](https://codeclimate.com/github/dao-rb/dao-gateway-active_resource)
5
6
  [![Test Coverage](https://codeclimate.com/github/dao-rb/dao-gateway-active_resource/badges/coverage.svg)](https://codeclimate.com/github/dao-rb/dao-gateway-active_resource/coverage)
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'dao-gateway', '~> 1.0'
21
+ spec.add_dependency 'dao-gateway', '~> 1.1'
22
22
  spec.add_dependency 'activeresource', '>= 4.1'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.11'
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'rspec', '~> 3.4'
27
27
  spec.add_development_dependency 'rspec-its'
28
28
  spec.add_development_dependency 'dao-entity', '~> 1.0'
29
+ spec.add_development_dependency 'codeclimate-test-reporter'
29
30
  end
@@ -4,6 +4,7 @@ require 'dao/gateway/active_resource/version'
4
4
  require 'active_resource'
5
5
  require 'active_support/hash_with_indifferent_access'
6
6
 
7
+ require 'dao/gateway/active_resource/resource_processor'
7
8
  require 'dao/gateway/active_resource/base'
8
9
  require 'dao/gateway/active_resource/base_transformer'
9
10
 
@@ -2,24 +2,14 @@ module Dao
2
2
  module Gateway
3
3
  module ActiveResource
4
4
  class BaseTransformer < Dao::Gateway::ScopeTransformer
5
- def many(relation)
6
- super(relation)
7
- end
8
-
9
5
  def one(relation)
10
6
  super(Array(relation))
11
7
  end
12
8
 
13
9
  private
14
10
 
15
- def transform(relation)
16
- super(relation) do |record|
17
- collect_attributes(record)
18
- end
19
- end
20
-
21
- def collect_attributes(record)
22
- HashWithIndifferentAccess.new(record.try(:serializable_hash))
11
+ def add_processors
12
+ @processors.unshift ResourceProcessor.new
23
13
  end
24
14
  end
25
15
  end
@@ -0,0 +1,11 @@
1
+ module Dao
2
+ module Gateway
3
+ module ActiveResource
4
+ class ResourceProcessor < Gateway::Processor
5
+ def process(record, *)
6
+ HashWithIndifferentAccess.new(record.try(:serializable_hash))
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,7 +1,7 @@
1
1
  module Dao
2
2
  module Gateway
3
3
  module ActiveResource
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dao-gateway-active_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - llxff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-06-29 00:00:00.000000000 Z
12
+ date: 2016-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dao-gateway
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.0'
20
+ version: '1.1'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.0'
27
+ version: '1.1'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activeresource
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -109,6 +109,20 @@ dependencies:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
111
  version: '1.0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: codeclimate-test-reporter
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
112
126
  description: Gateway for Active Resource
113
127
  email:
114
128
  - ll.wg.bin@gmail.com
@@ -129,6 +143,7 @@ files:
129
143
  - lib/dao/gateway/active_resource.rb
130
144
  - lib/dao/gateway/active_resource/base.rb
131
145
  - lib/dao/gateway/active_resource/base_transformer.rb
146
+ - lib/dao/gateway/active_resource/resource_processor.rb
132
147
  - lib/dao/gateway/active_resource/version.rb
133
148
  homepage: https://github.com/dao-rb/dao-gateway-active_resource
134
149
  licenses: