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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75523ebe41aa8e327db7ff2acc4fa20bf1283474b97baf6610e11292bb1abb8b
4
- data.tar.gz: 1c0293cf928ff1f6615d7f0a72a6ba7a03acdee04d00065ffc4a0eb41e0192ad
3
+ metadata.gz: adc97c5504b0171bfe253ae399f75ceabce09325656572f921520263023f3f8c
4
+ data.tar.gz: 35e0ca65e34c843ace959017ee2830e74d2f49878b8b0538f42ebde37855f6bb
5
5
  SHA512:
6
- metadata.gz: c0a39d8067f455a1c0179c65a7f17ffd041de405bc3c48be567970e2b987765216a33801e7c486c6aeee66cae5c2291f91196c3132bd9ad65d147617f6282468
7
- data.tar.gz: bdc24d37f171945127c2ff67c834fa55932c019dbbe5e74a2f1625d11b12ca881e6a2d0c6419c0ffe625bba3295b5ef2ef1e96d6256f152ca7fbaa3d2a99b52d
6
+ metadata.gz: 7ee982724e27a8252a7506dda4ea9bf0817bd39f258d9d1ea01bd9b393aa3e523043ff2120e191806a6d41df096bfde110abf4956e4cd56ee1064aa12f4def9f
7
+ data.tar.gz: 715e4b8a140e8be61be375500a701ede6c01f0a709aee0cde0b65bd809a04b4c50543900ca9ac7bcbedd30f4252ef66ae9f18246eaa5591d3a9eeb7d5ba28be4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.41.2
2
+
3
+ * Don't rely on `gemspec.source_paths` to list all the source locations in a gem. Hook any code that's loaded
4
+ from inside the `gem_dir`.
5
+
1
6
  # v0.41.1
2
7
 
3
8
  * Make best effort to ensure that class name is not `null` in the appmap.json.
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
- Add this line to *configuration.rb*:
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.org/applandinc/appmap-ruby.svg?branch=master)](https://travis-ci.org/applandinc/appmap-ruby)
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
- gem_paths(gem).map do |gem_path|
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 gem_paths(gem)
30
+ def gem_path(gem)
33
31
  gemspec = Gem.loaded_specs[gem] or raise "Gem #{gem.inspect} not found"
34
- gemspec.source_paths.map do |path|
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', package_name: 'active_support', labels: %w[provider.secure_compare])),
65
- 'ActionView::Renderer' => Hook.new(:render, Package.build_from_path('action_view', package_name: 'action_view', labels: %w[mvc.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 marshal])),
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
- [ Package.build_from_path(path, exclude: package['exclude'] || [], shallow: package['shallow']) ]
112
+ Package.build_from_path(path, exclude: package['exclude'] || [], shallow: package['shallow'])
113
113
  end
114
- end.flatten.compact
114
+ end.compact
115
115
  Config.new config_data['name'], packages, config_data['exclude'] || []
116
116
  end
117
117
  end
@@ -35,7 +35,7 @@ module AppMap
35
35
  else
36
36
  "#{hook_method.name} (class resolution deferred)"
37
37
  end
38
- warn "AppMap: Hooking " + msg
38
+ warn "AppMap: Hooking #{msg} at line #{(hook_method.source_location || []).join(':')}"
39
39
  end
40
40
 
41
41
  defined_class = @defined_class
@@ -3,7 +3,7 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.41.1'
6
+ VERSION = '0.41.2'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.4'
9
9
  end
@@ -19,6 +19,9 @@ services:
19
19
  environment:
20
20
  RAILS_ENV:
21
21
  ORM_MODULE:
22
+ PGHOST: pg
23
+ PGPORT: '5432'
24
+ DATABASE_URL: postgres://postgres@pg
22
25
  APPMAP:
23
26
  volumes:
24
27
  - .:/src/app
@@ -19,6 +19,9 @@ services:
19
19
  environment:
20
20
  RAILS_ENV:
21
21
  ORM_MODULE:
22
+ PGHOST: pg
23
+ PGPORT: '5432'
24
+ DATABASE_URL: postgres://postgres@pg
22
25
  APPMAP:
23
26
  volumes:
24
27
  - .:/src/app
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.1
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-02-10 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport