frenchy 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +3 -0
- data/frenchy.gemspec +1 -1
- data/lib/frenchy/client.rb +1 -4
- data/lib/frenchy/request.rb +1 -1
- data/lib/frenchy/version.rb +1 -1
- data/spec/lib/frenchy/request_spec.rb +6 -0
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 90c9e971bf0cee2367ca74b3c2f2342da1a5740acf2473d266fa97a574bbcb69
|
4
|
+
data.tar.gz: 8633892fd38e341447124b068f70ca11069ad4e684092694f61d184f87981fc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c5999ea947402f8f148bbea41536a6103826591aafa00e197e227b9dba11bc98118a3fe30cc0c0ee507b9613a2c51c926eba149f250e7748bfe9ae9e101009f
|
7
|
+
data.tar.gz: c68812567016ed5cd9feb96280cd10bcdb27c32ad279a643742557e204dd3f1936a7cf6a98304484a9a7dbc3eac59de1ced4a04361afab11532991ef1acb83ce
|
data/.travis.yml
CHANGED
data/frenchy.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_dependency "json"
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler"
|
23
|
+
spec.add_development_dependency "bundler"
|
24
24
|
spec.add_development_dependency "guard-rspec"
|
25
25
|
spec.add_development_dependency "rake"
|
26
26
|
spec.add_development_dependency "rspec"
|
data/lib/frenchy/client.rb
CHANGED
@@ -47,16 +47,13 @@ module Frenchy
|
|
47
47
|
private
|
48
48
|
|
49
49
|
def perform(method, path, params)
|
50
|
-
uri = URI(@host)
|
50
|
+
uri = URI(@host + path)
|
51
51
|
body = nil
|
52
52
|
headers = {
|
53
53
|
"User-Agent" => "Frenchy/#{Frenchy::VERSION}",
|
54
54
|
"Accept" => Frenchy.accept_header,
|
55
55
|
}.merge(@headers)
|
56
56
|
|
57
|
-
# Set the URI path
|
58
|
-
uri.path = URI.encode(path)
|
59
|
-
|
60
57
|
# Set request parameters
|
61
58
|
if params.any?
|
62
59
|
case method
|
data/lib/frenchy/request.rb
CHANGED
data/lib/frenchy/version.rb
CHANGED
@@ -7,6 +7,12 @@ describe Frenchy::Request do
|
|
7
7
|
expect(request.path).to eql("/v1/users/1234/md5something")
|
8
8
|
end
|
9
9
|
|
10
|
+
it "escapes path parameters but not query params" do
|
11
|
+
request = Frenchy::Request.new("service", "get", "/v1/users/:slug/:fullname", {"slug" => "big dog 20", "fullname" => "How Big Is He?", "division" => "How Big Is He, Really?"}, {})
|
12
|
+
expect(request.path).to eql("/v1/users/big+dog+20/How+Big+Is+He%3F")
|
13
|
+
expect(request.params).to eql({"division" => "How Big Is He, Really?"})
|
14
|
+
end
|
15
|
+
|
10
16
|
it "retains remaining parameters as query parameters" do
|
11
17
|
request = Frenchy::Request.new("service", "get", "/v1/users/:id", {"id" => 1234, "token" => "md5something"}, {})
|
12
18
|
expect(request.path).to eql("/v1/users/1234")
|
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.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Coene
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: guard-rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,7 +165,7 @@ homepage: https://github.com/jcoene/frenchy
|
|
165
165
|
licenses:
|
166
166
|
- MIT
|
167
167
|
metadata: {}
|
168
|
-
post_install_message:
|
168
|
+
post_install_message:
|
169
169
|
rdoc_options: []
|
170
170
|
require_paths:
|
171
171
|
- lib
|
@@ -180,9 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
|
184
|
-
|
185
|
-
signing_key:
|
183
|
+
rubygems_version: 3.2.3
|
184
|
+
signing_key:
|
186
185
|
specification_version: 4
|
187
186
|
summary: Opinionated JSON API modeling framework for Ruby.
|
188
187
|
test_files:
|