active_rest_client 0.9.65 → 0.9.66
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/README.md +2 -0
- data/Rakefile +2 -0
- data/active_rest_client.gemspec +1 -0
- data/lib/active_rest_client/base.rb +1 -1
- data/lib/active_rest_client/lazy_association_loader.rb +1 -1
- data/lib/active_rest_client/version.rb +1 -1
- data/spec/lib/base_spec.rb +1 -1
- data/spec/lib/request_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccfdfcc6a1a86c7b5715f7666c383abf9d99481b
|
4
|
+
data.tar.gz: 678bcfbdab8714ce08456de2a1d1bd569017eba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cffb6450b43e6346772df324e73bbdb23b7db4feb47c9b305c55a3db41c9414d04f308438d388e55d33d1d8f273946dd9711a008b671339d1fa58778da930e74
|
7
|
+
data.tar.gz: 2140ca597671d258f351bcd040e827629f9ad9a2c3e92c726e75f509d05cdf782ec87f9837349bb3c6897a9ed34478eccda6240823281e51d8e7c01ff6fa8778
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# ActiveRestClient
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/whichdigital/active-rest-client.png?branch=master)](https://travis-ci.org/whichdigital/active-rest-client) [![Coverage Status](https://coveralls.io/repos/whichdigital/active-rest-client/badge.png)](https://coveralls.io/r/whichdigital/active-rest-client) [![Code Climate](https://codeclimate.com/github/whichdigital/active-rest-client.png)](https://codeclimate.com/github/whichdigital/active-rest-client) [![Gem Version](https://badge.fury.io/rb/active_rest_client.png)](http://badge.fury.io/rb/active_rest_client)
|
4
|
+
|
3
5
|
This gem is for accessing REST services in an ActiveRecord style. ActiveResource already exists for this, but it doesn't work where the resource naming doesn't follow Rails conventions, it doesn't have in-built caching and it's not as flexible in general.
|
4
6
|
|
5
7
|
## Installation
|
data/Rakefile
CHANGED
data/active_rest_client.gemspec
CHANGED
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency "simplecov-rcov"
|
28
28
|
spec.add_development_dependency "guard-rspec"
|
29
29
|
spec.add_development_dependency 'terminal-notifier-guard'
|
30
|
+
spec.add_development_dependency 'coveralls'
|
30
31
|
|
31
32
|
spec.add_runtime_dependency "oj", "=2.1.4" # 2.1.7 breaks under linux
|
32
33
|
spec.add_runtime_dependency "activesupport"
|
@@ -10,7 +10,7 @@ module ActiveRestClient
|
|
10
10
|
attr_accessor :_status
|
11
11
|
|
12
12
|
instance_methods.each do |m|
|
13
|
-
next unless %
|
13
|
+
next unless %w{display errors presence load require hash untrust trust freeze method enable_warnings with_warnings suppress capture silence quietly debugger breakpoint}.map(&:to_sym).include? m
|
14
14
|
undef_method m
|
15
15
|
end
|
16
16
|
|
@@ -80,7 +80,7 @@ module ActiveRestClient
|
|
80
80
|
|
81
81
|
def ensure_lazy_loaded
|
82
82
|
if @object.nil?
|
83
|
-
method
|
83
|
+
method = Oj.load(Oj.dump(@request.method))
|
84
84
|
method[:method] = :get
|
85
85
|
method[:options][:url] = @url
|
86
86
|
method[:options][:overriden_name] = @options[:overriden_name]
|
data/spec/lib/base_spec.rb
CHANGED
@@ -64,7 +64,7 @@ describe ActiveRestClient::Base do
|
|
64
64
|
client.each do |key, value|
|
65
65
|
keys << key ; values << value
|
66
66
|
end
|
67
|
-
expect(keys).to eq(%
|
67
|
+
expect(keys).to eq(%w{name country}.map(&:to_sym))
|
68
68
|
expect(values).to eq(["Billy", "United Kingdom"])
|
69
69
|
end
|
70
70
|
|
data/spec/lib/request_spec.rb
CHANGED
@@ -27,7 +27,7 @@ describe ActiveRestClient::Request do
|
|
27
27
|
class LazyLoadedExampleClient < ExampleClient
|
28
28
|
lazy_load!
|
29
29
|
get :fake, "/fake", fake:"{\"result\":true, \"list\":[1,2,3,{\"test\":true}], \"child\":{\"grandchild\":{\"test\":true}}}"
|
30
|
-
get :lazy_test, "/does-not-matter", fake:"{\"people\":[\"http://www.example.com/some/url\"]}", :lazy =>
|
30
|
+
get :lazy_test, "/does-not-matter", fake:"{\"people\":[\"http://www.example.com/some/url\"]}", :lazy => [:people]
|
31
31
|
end
|
32
32
|
|
33
33
|
class VerboseExampleClient < ExampleClient
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_rest_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.66
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Which Ltd
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -123,6 +123,20 @@ dependencies:
|
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: coveralls
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: oj
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,6 +190,7 @@ files:
|
|
176
190
|
- ".gitignore"
|
177
191
|
- ".rspec"
|
178
192
|
- ".simplecov"
|
193
|
+
- ".travis.yml"
|
179
194
|
- Gemfile
|
180
195
|
- Guardfile
|
181
196
|
- LICENSE.txt
|