frenchy 0.6.2 → 0.7.0

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: 914068dbbf6fac783c5b03a2c95f503e1603bbc758e31da5ab34815058e9cf87
4
+ data.tar.gz: a0beb51d1030f49fd45a64b1b18efbcefc6c6c37ab70046dfd7390232605bf6b
5
5
  SHA512:
6
- metadata.gz: 7d727f9ad761e2033e31b133a764390f0e4bc371c0502cd849051c0a4c382f1f7fc556d4af9c8652d427c9fc6db7d8825ca8e1781f826fc18de238fddeeec520
7
- data.tar.gz: 2478df6e201ec0e38b8afef4d149b1ed4b78f249a1a9c62e2ff11721c4c7c71c7cb167dac3ea60e1b2cf60f095583ecb076835bad024c294656ef72ee9789ae6
6
+ metadata.gz: 7c786f0da7a2f3bb71719f2cfbd9d9e6adb22dfb6df34212be5691eb9104298ca576a5201f97e2025441390c3f22e698c636fb52f8099ff1ebf0abf27f50b0ec
7
+ data.tar.gz: 9fb931b61d535e21211d0601d20674fad0b98b509c829caf226b81dec27bbae033271a6cc6cb9083e24a3f6b00ff0f70d46d37653e794cbc5447a007b80f1e96
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3.4
4
- - 2.4.1
3
+ - 3.0.6
4
+ - 3.1.1
data/frenchy.gemspec CHANGED
@@ -20,11 +20,11 @@ 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"
27
- spec.add_development_dependency "coveralls"
28
- spec.add_development_dependency "activesupport", ">= 3.0"
29
- spec.add_development_dependency "activemodel", ">= 3.0"
27
+ spec.add_development_dependency "coveralls"
28
+ spec.add_development_dependency "activesupport", ">= 7.0"
29
+ spec.add_development_dependency "activemodel", ">= 7.0"
30
30
  end
@@ -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
@@ -16,7 +16,7 @@ if defined?(ActiveSupport)
16
16
  Thread.current[:frenchy_runtime] += event.duration
17
17
  if logger.debug?
18
18
  name = "%s (%.2fms)" % [event.payload[:service].capitalize, event.duration]
19
- output = " #{color(name, YELLOW, true)} #{event.payload[:method].to_s.upcase} #{event.payload[:path]}"
19
+ output = " #{color(name, YELLOW, bold: true)} #{event.payload[:method].to_s.upcase} #{event.payload[:path]}"
20
20
  if event.payload[:params].any?
21
21
  output += "?"
22
22
  output += event.payload[:params].map {|k,v| "#{k}=#{v}" }.join("&")
@@ -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.7.0"
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.7.0
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: 2023-11-03 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
@@ -100,28 +100,28 @@ dependencies:
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '3.0'
103
+ version: '7.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '3.0'
110
+ version: '7.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: activemodel
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '3.0'
117
+ version: '7.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '3.0'
124
+ version: '7.0'
125
125
  description: Opinionated JSON API modeling framework for Ruby.
126
126
  email:
127
127
  - jcoene@gmail.com
@@ -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.33
184
+ signing_key:
186
185
  specification_version: 4
187
186
  summary: Opinionated JSON API modeling framework for Ruby.
188
187
  test_files: