appmap 0.41.1 → 0.41.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +18 -16
- data/lib/appmap/config.rb +12 -12
- data/lib/appmap/hook/method.rb +1 -1
- data/lib/appmap/version.rb +1 -1
- data/spec/fixtures/rails5_users_app/docker-compose.yml +3 -0
- data/spec/fixtures/rails6_users_app/docker-compose.yml +3 -0
- 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: adc97c5504b0171bfe253ae399f75ceabce09325656572f921520263023f3f8c
|
4
|
+
data.tar.gz: 35e0ca65e34c843ace959017ee2830e74d2f49878b8b0538f42ebde37855f6bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ee982724e27a8252a7506dda4ea9bf0817bd39f258d9d1ea01bd9b393aa3e523043ff2120e191806a6d41df096bfde110abf4956e4cd56ee1064aa12f4def9f
|
7
|
+
data.tar.gz: 715e4b8a140e8be61be375500a701ede6c01f0a709aee0cde0b65bd809a04b4c50543900ca9ac7bcbedd30f4252ef66ae9f18246eaa5591d3a9eeb7d5ba28be4
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -82,6 +82,22 @@ If you are using Ruby on Rails, require the railtie after Rails is loaded.
|
|
82
82
|
require 'appmap/railtie' if defined?(AppMap).
|
83
83
|
```
|
84
84
|
|
85
|
+
**application.rb**
|
86
|
+
|
87
|
+
Add this line to *application.rb*, to enable server recording with `APPMAP_RECORD=true`:
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
module MyApp
|
91
|
+
class Application < Rails::Application
|
92
|
+
...
|
93
|
+
|
94
|
+
config.appmap.enabled = true if ENV['APPMAP_RECORD']
|
95
|
+
|
96
|
+
...
|
97
|
+
end
|
98
|
+
end
|
99
|
+
```
|
100
|
+
|
85
101
|
# Configuration
|
86
102
|
|
87
103
|
When you run your program, the `appmap` gem reads configuration settings from `appmap.yml`. Here's a sample configuration
|
@@ -309,21 +325,7 @@ $ bundle exec rails server
|
|
309
325
|
|
310
326
|
## Server process recording
|
311
327
|
|
312
|
-
|
313
|
-
|
314
|
-
```ruby
|
315
|
-
module MyApp
|
316
|
-
class Application < Rails::Application
|
317
|
-
...
|
318
|
-
|
319
|
-
config.appmap.enabled = true if ENV['APPMAP_RECORD']
|
320
|
-
|
321
|
-
...
|
322
|
-
end
|
323
|
-
end
|
324
|
-
```
|
325
|
-
|
326
|
-
With this setting, you can run your Rails server with `APPMAP_RECORD=true`. When the server exits, an *appmap.json* file will be written to the project directory. This is a great way to start the server, interact with your app as a user (or through it's API), and then view an AppMap of everything that happened.
|
328
|
+
Run your Rails server with `APPMAP_RECORD=true`. When the server exits, an *appmap.json* file will be written to the project directory. This is a great way to start the server, interact with your app as a user (or through it's API), and then view an AppMap of everything that happened.
|
327
329
|
|
328
330
|
Be sure and set `WEB_CONCURRENCY=1`, if you are using a webserver that can run multiple processes. You only want there to be one process while you are recording, otherwise they will both try and write *appmap.json* and one of them will clobber the other.
|
329
331
|
|
@@ -338,7 +340,7 @@ The [AppMap extension for VSCode](https://marketplace.visualstudio.com/items?ite
|
|
338
340
|
For instructions on uploading, see the documentation of the [AppLand CLI](https://github.com/applandinc/appland-cli).
|
339
341
|
|
340
342
|
# Development
|
341
|
-
[![Build Status](https://travis-ci.
|
343
|
+
[![Build Status](https://travis-ci.com/applandinc/appmap-ruby.svg?branch=master)](https://travis-ci.com/applandinc/appmap-ruby)
|
342
344
|
|
343
345
|
## Running tests
|
344
346
|
|
data/lib/appmap/config.rb
CHANGED
@@ -20,20 +20,16 @@ module AppMap
|
|
20
20
|
warn "WARNING: #{gem} cannot be AppMapped because it is a dependency of the appmap gem"
|
21
21
|
return
|
22
22
|
end
|
23
|
-
|
24
|
-
Package.new(gem_path, gem, package_name, exclude, labels, shallow)
|
25
|
-
end
|
23
|
+
Package.new(gem_path(gem), gem, package_name, exclude, labels, shallow)
|
26
24
|
end
|
27
25
|
|
28
26
|
private_class_method :new
|
29
27
|
|
30
28
|
protected
|
31
29
|
|
32
|
-
def
|
30
|
+
def gem_path(gem)
|
33
31
|
gemspec = Gem.loaded_specs[gem] or raise "Gem #{gem.inspect} not found"
|
34
|
-
gemspec.
|
35
|
-
File.join(gemspec.gem_dir, path)
|
36
|
-
end
|
32
|
+
gemspec.gem_dir
|
37
33
|
end
|
38
34
|
end
|
39
35
|
|
@@ -61,8 +57,12 @@ module AppMap
|
|
61
57
|
# Methods that should always be hooked, with their containing
|
62
58
|
# package and labels that should be applied to them.
|
63
59
|
HOOKED_METHODS = {
|
64
|
-
'ActiveSupport::SecurityUtils' => Hook.new(:secure_compare, Package.build_from_path('active_support',
|
65
|
-
'ActionView::Renderer' => Hook.new(:render, Package.build_from_path('action_view',
|
60
|
+
'ActiveSupport::SecurityUtils' => Hook.new(:secure_compare, Package.build_from_path('active_support', labels: %w[provider.secure_compare])),
|
61
|
+
'ActionView::Renderer' => Hook.new(:render, Package.build_from_path('action_view', labels: %w[mvc.view])),
|
62
|
+
'ActionDispatch::Cookies::CookieJar' => Hook.new(%i[[]= clear update delete recycle], Package.build_from_path('action_pack', labels: %w[provider.http.cookie])),
|
63
|
+
'ActionDispatch::Cookies::EncryptedCookieJar' => Hook.new(%i[[]=], Package.build_from_path('action_pack', labels: %w[provider.http.cookie crypto])),
|
64
|
+
'CanCan::ControllerAdditions' => Hook.new(%i[authorize! can? cannot?], Package.build_from_path('cancancan', labels: %w[provider.authorization])),
|
65
|
+
'CanCan::Ability' => Hook.new(%i[authorize!], Package.build_from_path('cancancan', labels: %w[provider.authorization])),
|
66
66
|
}.freeze
|
67
67
|
|
68
68
|
BUILTIN_METHODS = {
|
@@ -75,7 +75,7 @@ module AppMap
|
|
75
75
|
'Net::SMTP' => Hook.new(:send, Package.build_from_path('net/smtp', package_name: 'net/smtp', labels: %w[protocol.smtp protocol.email io])),
|
76
76
|
'Net::POP3' => Hook.new(:mails, Package.build_from_path('net/pop3', package_name: 'net/pop', labels: %w[protocol.pop protocol.email io])),
|
77
77
|
'Net::IMAP' => Hook.new(:send_command, Package.build_from_path('net/imap', package_name: 'net/imap', labels: %w[protocol.imap protocol.email io])),
|
78
|
-
'Marshal' => Hook.new(%i[dump load], Package.build_from_path('marshal', labels: %w[format.marshal provider.serialization
|
78
|
+
'Marshal' => Hook.new(%i[dump load], Package.build_from_path('marshal', labels: %w[format.marshal provider.serialization])),
|
79
79
|
'Psych' => Hook.new(%i[dump dump_stream load load_stream parse parse_stream], Package.build_from_path('yaml', package_name: 'psych', labels: %w[format.yaml provider.serialization])),
|
80
80
|
'JSON::Ext::Parser' => Hook.new(:parse, Package.build_from_path('json', package_name: 'json', labels: %w[format.json provider.serialization])),
|
81
81
|
'JSON::Ext::Generator::State' => Hook.new(:generate, Package.build_from_path('json', package_name: 'json', labels: %w[format.json provider.serialization])),
|
@@ -109,9 +109,9 @@ module AppMap
|
|
109
109
|
shallow = true if shallow.nil?
|
110
110
|
Package.build_from_gem(gem, exclude: package['exclude'] || [], shallow: shallow)
|
111
111
|
else
|
112
|
-
|
112
|
+
Package.build_from_path(path, exclude: package['exclude'] || [], shallow: package['shallow'])
|
113
113
|
end
|
114
|
-
end.
|
114
|
+
end.compact
|
115
115
|
Config.new config_data['name'], packages, config_data['exclude'] || []
|
116
116
|
end
|
117
117
|
end
|
data/lib/appmap/hook/method.rb
CHANGED
data/lib/appmap/version.rb
CHANGED
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.41.
|
4
|
+
version: 0.41.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|