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 +5 -5
- data/.travis.yml +2 -2
- data/frenchy.gemspec +4 -4
- data/lib/frenchy/client.rb +1 -4
- data/lib/frenchy/instrumentation.rb +1 -1
- data/lib/frenchy/request.rb +1 -1
- data/lib/frenchy/version.rb +1 -1
- data/spec/lib/frenchy/request_spec.rb +6 -0
- metadata +14 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 914068dbbf6fac783c5b03a2c95f503e1603bbc758e31da5ab34815058e9cf87
|
4
|
+
data.tar.gz: a0beb51d1030f49fd45a64b1b18efbcefc6c6c37ab70046dfd7390232605bf6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c786f0da7a2f3bb71719f2cfbd9d9e6adb22dfb6df34212be5691eb9104298ca576a5201f97e2025441390c3f22e698c636fb52f8099ff1ebf0abf27f50b0ec
|
7
|
+
data.tar.gz: 9fb931b61d535e21211d0601d20674fad0b98b509c829caf226b81dec27bbae033271a6cc6cb9083e24a3f6b00ff0f70d46d37653e794cbc5447a007b80f1e96
|
data/.travis.yml
CHANGED
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"
|
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
|
28
|
-
spec.add_development_dependency "activesupport", ">=
|
29
|
-
spec.add_development_dependency "activemodel", ">=
|
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
|
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
|
@@ -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("&")
|
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.
|
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:
|
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: '
|
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
|
@@ -100,28 +100,28 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
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: '
|
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: '
|
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: '
|
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
|
-
|
184
|
-
|
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:
|