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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 900479619e9ddf60c44f879d9f1ba83c7176f5b6
4
- data.tar.gz: 9b6796a87ef2700a544526ea9a7d0d51a2fca979
2
+ SHA256:
3
+ metadata.gz: 90c9e971bf0cee2367ca74b3c2f2342da1a5740acf2473d266fa97a574bbcb69
4
+ data.tar.gz: 8633892fd38e341447124b068f70ca11069ad4e684092694f61d184f87981fc1
5
5
  SHA512:
6
- metadata.gz: 7d727f9ad761e2033e31b133a764390f0e4bc371c0502cd849051c0a4c382f1f7fc556d4af9c8652d427c9fc6db7d8825ca8e1781f826fc18de238fddeeec520
7
- data.tar.gz: 2478df6e201ec0e38b8afef4d149b1ed4b78f249a1a9c62e2ff11721c4c7c71c7cb167dac3ea60e1b2cf60f095583ecb076835bad024c294656ef72ee9789ae6
6
+ metadata.gz: 7c5999ea947402f8f148bbea41536a6103826591aafa00e197e227b9dba11bc98118a3fe30cc0c0ee507b9613a2c51c926eba149f250e7748bfe9ae9e101009f
7
+ data.tar.gz: c68812567016ed5cd9feb96280cd10bcdb27c32ad279a643742557e204dd3f1936a7cf6a98304484a9a7dbc3eac59de1ced4a04361afab11532991ef1acb83ce
data/.travis.yml CHANGED
@@ -2,3 +2,6 @@ language: ruby
2
2
  rvm:
3
3
  - 2.3.4
4
4
  - 2.4.1
5
+ - 2.5.9
6
+ - 2.7.3
7
+ - 3.0.1
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", "~> 1.3"
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"
@@ -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
@@ -19,7 +19,7 @@ module Frenchy
19
19
  end
20
20
 
21
21
  params.delete(k)
22
- path.sub!(pat, v)
22
+ path.sub!(pat, CGI.escape(v))
23
23
  end
24
24
 
25
25
  @service = service
@@ -1,3 +1,3 @@
1
1
  module Frenchy
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
@@ -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.2
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: 2017-05-28 00:00:00.000000000 Z
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: '1.3'
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: '1.3'
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
- rubyforge_project:
184
- rubygems_version: 2.6.11
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: