appmap 0.46.0 → 0.47.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/appmap/handler/rails/request_handler.rb +1 -1
- data/lib/appmap/util.rb +10 -0
- data/lib/appmap/version.rb +1 -1
- data/spec/abstract_controller_base_spec.rb +2 -2
- data/spec/util_spec.rb +18 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1f2b43daf0437ceb6073a64272148ca9168c4ac781c01e2e73c36259a3bcc7b
|
4
|
+
data.tar.gz: 2a7275d2be15d2bfcf0c2dfc898807212840506c3692232b2d049bc771a4a3b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5000bdc938facaa5e181de6e3d6023c6a1b1a1e48a260545ae3245236bf271e22ab6462c16d1c73fb44b4e9bc4e6533f8be12428e2d7ff9e1c06f65ec1992bf7
|
7
|
+
data.tar.gz: 10db3cd34b1f9eb5f81070607d12b6a714b12735ac25828df4c6a3e50d0efa354ad9ff9206bc42cd2d7ccb61ffef83f663d41b3896928f0fd9bdd1e53ed4e543
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [0.47.0](https://github.com/applandinc/appmap-ruby/compare/v0.46.0...v0.47.0) (2021-05-13)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* Emit swagger-style normalized paths instead of Rails-style ones ([5a93cd7](https://github.com/applandinc/appmap-ruby/commit/5a93cd7096ca195146a84a6733c7d502dbcd0272))
|
7
|
+
|
1
8
|
# [0.46.0](https://github.com/applandinc/appmap-ruby/compare/v0.45.1...v0.46.0) (2021-05-12)
|
2
9
|
|
3
10
|
|
data/lib/appmap/util.rb
CHANGED
@@ -101,6 +101,16 @@ module AppMap
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
# Convert a Rails-style path from /org/:org_id(.:format)
|
105
|
+
# to Swagger-style paths like /org/{org_id}
|
106
|
+
def swaggerize_path(path)
|
107
|
+
path = path.split('(.')[0]
|
108
|
+
tokens = path.split('/')
|
109
|
+
tokens.map do |token|
|
110
|
+
token.gsub /^:(.*)/, '{\1}'
|
111
|
+
end.join('/')
|
112
|
+
end
|
113
|
+
|
104
114
|
# Atomically writes AppMap data to +filename+.
|
105
115
|
def write_appmap(filename, appmap)
|
106
116
|
require 'fileutils'
|
data/lib/appmap/version.rb
CHANGED
@@ -42,7 +42,7 @@ describe 'Rails' do
|
|
42
42
|
hash_including(
|
43
43
|
'http_server_request' => hash_including(
|
44
44
|
'request_method' => 'POST',
|
45
|
-
'normalized_path_info' => '/api/users
|
45
|
+
'normalized_path_info' => '/api/users',
|
46
46
|
'path_info' => '/api/users'
|
47
47
|
),
|
48
48
|
'message' => include(
|
@@ -197,7 +197,7 @@ describe 'Rails' do
|
|
197
197
|
'http_server_request' => {
|
198
198
|
'request_method' => 'GET',
|
199
199
|
'path_info' => '/users/alice',
|
200
|
-
'normalized_path_info' => '/users
|
200
|
+
'normalized_path_info' => '/users/{id}',
|
201
201
|
'headers' => {
|
202
202
|
'Host' => 'test.host',
|
203
203
|
'User-Agent' => 'Rails Testing'
|
data/spec/util_spec.rb
CHANGED
@@ -4,8 +4,8 @@ require 'spec_helper'
|
|
4
4
|
require 'appmap/util'
|
5
5
|
|
6
6
|
describe AppMap::Util, docker: false do
|
7
|
-
let(:subject) { AppMap::Util.method(:scenario_filename) }
|
8
7
|
describe 'scenario_filename' do
|
8
|
+
let(:subject) { AppMap::Util.method(:scenario_filename) }
|
9
9
|
it 'leaves short names alone' do
|
10
10
|
expect(subject.call('foobar')).to eq('foobar.appmap.json')
|
11
11
|
end
|
@@ -18,4 +18,21 @@ describe AppMap::Util, docker: false do
|
|
18
18
|
expect(subject.call(fname, max_length: 50)).to eq('abcdefghijklmno-RAd_SFbH1sUZ_OXfwPsfzw.appmap.json')
|
19
19
|
end
|
20
20
|
end
|
21
|
+
describe 'swaggerize path' do
|
22
|
+
it 'replaces rails-style parameters' do
|
23
|
+
expect(AppMap::Util.swaggerize_path('/org/:org_id(.:format)')).to eq('/org/{org_id}')
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'strips the format specifier' do
|
27
|
+
expect(AppMap::Util.swaggerize_path('/org(.:format)')).to eq('/org')
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'ignores malformed parameter specs' do
|
31
|
+
expect(AppMap::Util.swaggerize_path('/org/o:rg_id')).to eq('/org/o:rg_id')
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'ignores already swaggerized paths' do
|
35
|
+
expect(AppMap::Util.swaggerize_path('/org/{org_id}')).to eq('/org/{org_id}')
|
36
|
+
end
|
37
|
+
end
|
21
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.47.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|