frenchy 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/frenchy/resource.rb +1 -1
- data/lib/frenchy/version.rb +1 -1
- data/spec/lib/frenchy/resource_spec.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 755aa8a35ab0b0d40c2a875c0e917b3acd30142b
|
4
|
+
data.tar.gz: 8fb75094c4051c595071ed07526f63fd7bc0d465
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63325bcbd4d405b5d866277f9e8608b63393fcba92beb34abd5f0e4d5b092f2f5340e376e0287a256976e53d05c5d4c8ff85f82392585e9de44dfd988fa1ab23
|
7
|
+
data.tar.gz: 1b58dcad673e8fe998539a443a5311f390f5f3a6a4661eafc4f51a552b3300ef8b5232db5cd7a600b4a6ecb7d04e1b235d3bdd0c12b9caf3b8ad5266eaaded30
|
data/lib/frenchy/resource.rb
CHANGED
@@ -26,7 +26,7 @@ module Frenchy
|
|
26
26
|
params.stringify_keys!
|
27
27
|
name, endpoint = resolve_endpoints(endpoints)
|
28
28
|
method = endpoint["method"] || "get"
|
29
|
-
extras = {"model" => self.name, "endpoint" => name}
|
29
|
+
extras = {"model" => self.name.underscore, "endpoint" => name}
|
30
30
|
|
31
31
|
response = Frenchy::Request.new(@service, method, endpoint["path"], params, extras).value
|
32
32
|
digest_response(response, endpoint)
|
data/lib/frenchy/version.rb
CHANGED
@@ -101,5 +101,16 @@ describe Frenchy::Resource do
|
|
101
101
|
BinNoEndpoints.find_with_endpoint(:nonexist, myarg: "mydata")
|
102
102
|
end.to raise_exception(Frenchy::Error)
|
103
103
|
end
|
104
|
+
|
105
|
+
it "includes the under_score model name in extras" do
|
106
|
+
response = double("Frenchy::Request", value: {})
|
107
|
+
|
108
|
+
expect(Frenchy::Request).
|
109
|
+
to receive(:new).
|
110
|
+
with("httpbin", "get", "/get", {"id" => 1}, {"model" => "bin_one_endpoint", "endpoint" => "default"}).
|
111
|
+
and_return(response)
|
112
|
+
|
113
|
+
BinOneEndpoint.find_with_endpoint(:default, id: 1)
|
114
|
+
end
|
104
115
|
end
|
105
116
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frenchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Coene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
181
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.2.
|
182
|
+
rubygems_version: 2.2.0
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
185
|
summary: Opinionated JSON API modeling framework for Ruby.
|