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 +4 -4
- data/.travis.yml +2 -0
- data/README.md +1 -0
- data/dao-gateway-active_resource.gemspec +2 -1
- data/lib/dao/gateway/active_resource.rb +1 -0
- data/lib/dao/gateway/active_resource/base_transformer.rb +2 -12
- data/lib/dao/gateway/active_resource/resource_processor.rb +11 -0
- data/lib/dao/gateway/active_resource/version.rb +1 -1
- metadata +19 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 009d64b19fabf9d073230a4203c9c8bc00704108
|
4
|
+
data.tar.gz: 747bfd831530458d0a23aebd12a8e192355dcc87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0b1e990345cb01ba3d4316ec53d6a6c9916cbdc18d8194429832b5b5f8c98b6de18906d6a1eba68c1a658f03548b81ef21130c9a355f550e5ceb6e190e0fd4a
|
7
|
+
data.tar.gz: 1336db860d01f50a01c4ceb98d656d26d919fbeaec0be0f9f577c66be3cc7dbbe4c6d4d1330c55f5c8adac22b69f0077a1f5bd890274cb38c21c7ba4dcdf7271
|
data/.travis.yml
CHANGED
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.
|
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
|
16
|
-
|
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
|
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.
|
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-
|
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.
|
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.
|
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:
|