appmap 0.35.2 → 0.39.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +1 -1
  3. data/.gitignore +2 -1
  4. data/.rubocop.yml +15 -1
  5. data/.travis.yml +0 -7
  6. data/CHANGELOG.md +22 -0
  7. data/README.md +24 -12
  8. data/Rakefile +3 -2
  9. data/appmap.gemspec +2 -1
  10. data/appmap.yml +1 -7
  11. data/lib/appmap.rb +2 -2
  12. data/lib/appmap/class_map.rb +20 -6
  13. data/lib/appmap/config.rb +66 -22
  14. data/lib/appmap/event.rb +16 -1
  15. data/lib/appmap/hook/method.rb +18 -12
  16. data/lib/appmap/rails/request_handler.rb +20 -4
  17. data/lib/appmap/railtie.rb +1 -1
  18. data/lib/appmap/rspec.rb +1 -1
  19. data/lib/appmap/trace.rb +18 -7
  20. data/lib/appmap/version.rb +2 -2
  21. data/spec/abstract_controller4_base_spec.rb +27 -28
  22. data/spec/abstract_controller_base_spec.rb +132 -67
  23. data/spec/class_map_spec.rb +36 -0
  24. data/spec/fixtures/hook/instance_method.rb +4 -0
  25. data/spec/fixtures/{rails_users_app → rails5_users_app}/.dockerignore +0 -0
  26. data/spec/fixtures/{rails_users_app → rails5_users_app}/.gitignore +0 -0
  27. data/spec/fixtures/{rails_users_app → rails5_users_app}/.rspec +0 -0
  28. data/{.ruby-version → spec/fixtures/rails5_users_app/.ruby-version} +0 -0
  29. data/spec/fixtures/{rails_users_app → rails5_users_app}/Dockerfile +0 -0
  30. data/spec/fixtures/{rails_users_app → rails5_users_app}/Dockerfile.pg +0 -0
  31. data/spec/fixtures/rails5_users_app/Gemfile +51 -0
  32. data/spec/fixtures/{rails_users_app → rails5_users_app}/Rakefile +0 -0
  33. data/spec/fixtures/{rails_users_app → rails5_users_app}/app/controllers/api/users_controller.rb +0 -0
  34. data/spec/fixtures/{rails_users_app → rails5_users_app}/app/controllers/application_controller.rb +0 -0
  35. data/spec/fixtures/{rails_users_app → rails5_users_app}/app/controllers/concerns/.keep +0 -0
  36. data/spec/fixtures/{rails_users_app → rails5_users_app}/app/controllers/health_controller.rb +0 -0
  37. data/spec/fixtures/rails5_users_app/app/controllers/users_controller.rb +13 -0
  38. data/spec/fixtures/{rails_users_app → rails5_users_app}/app/models/activerecord/user.rb +0 -0
  39. data/spec/fixtures/{rails_users_app → rails5_users_app}/app/models/concerns/.keep +0 -0
  40. data/spec/fixtures/{rails_users_app → rails5_users_app}/app/models/sequel/user.rb +0 -0
  41. data/spec/fixtures/{rails_users_app → rails5_users_app}/app/views/layouts/application.html.haml +0 -0
  42. data/spec/fixtures/{rails_users_app → rails5_users_app}/app/views/users/index.html.haml +0 -0
  43. data/spec/fixtures/rails5_users_app/appmap.yml +4 -0
  44. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/appmap +0 -0
  45. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/byebug +0 -0
  46. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/gli +0 -0
  47. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/htmldiff +0 -0
  48. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/ldiff +0 -0
  49. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/nokogiri +0 -0
  50. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/rackup +0 -0
  51. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/rails +0 -0
  52. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/rake +0 -0
  53. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/rspec +0 -0
  54. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/ruby-parse +0 -0
  55. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/ruby-rewrite +0 -0
  56. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/sequel +0 -0
  57. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/setup +0 -0
  58. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/sprockets +0 -0
  59. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/thor +0 -0
  60. data/spec/fixtures/{rails_users_app → rails5_users_app}/bin/update +0 -0
  61. data/spec/fixtures/{rails_users_app → rails5_users_app}/config.ru +0 -0
  62. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/application.rb +0 -0
  63. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/boot.rb +0 -0
  64. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/credentials.yml.enc +0 -0
  65. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/database.yml +0 -0
  66. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/environment.rb +0 -0
  67. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/environments/development.rb +0 -0
  68. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/environments/production.rb +0 -0
  69. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/environments/test.rb +0 -0
  70. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/application_controller_renderer.rb +0 -0
  71. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/backtrace_silencers.rb +0 -0
  72. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/cors.rb +0 -0
  73. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/filter_parameter_logging.rb +0 -0
  74. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/inflections.rb +0 -0
  75. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/mime_types.rb +0 -0
  76. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/record_button.rb +0 -0
  77. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/initializers/wrap_parameters.rb +0 -0
  78. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/locales/en.yml +0 -0
  79. data/spec/fixtures/{rails_users_app → rails5_users_app}/config/routes.rb +1 -1
  80. data/spec/fixtures/{rails_users_app → rails5_users_app}/create_app +0 -0
  81. data/spec/fixtures/{rails_users_app → rails5_users_app}/db/migrate/20190728211408_create_users.rb +0 -0
  82. data/spec/fixtures/{rails_users_app → rails5_users_app}/db/schema.rb +0 -0
  83. data/spec/fixtures/{rails_users_app → rails5_users_app}/docker-compose.yml +0 -0
  84. data/spec/fixtures/{rails_users_app → rails5_users_app}/features/api_users.feature +0 -0
  85. data/spec/fixtures/{rails_users_app → rails5_users_app}/features/support/env.rb +0 -0
  86. data/spec/fixtures/{rails_users_app → rails5_users_app}/features/support/hooks.rb +0 -0
  87. data/spec/fixtures/{rails_users_app → rails5_users_app}/features/support/steps.rb +0 -0
  88. data/spec/fixtures/{rails_users_app → rails5_users_app}/lib/tasks/.keep +0 -0
  89. data/spec/fixtures/{rails_users_app → rails5_users_app}/log/.keep +0 -0
  90. data/spec/fixtures/{rails_users_app → rails5_users_app}/public/robots.txt +0 -0
  91. data/spec/fixtures/{rails_users_app → rails5_users_app}/spec/controllers/users_controller_api_spec.rb +1 -1
  92. data/spec/fixtures/rails5_users_app/spec/controllers/users_controller_spec.rb +27 -0
  93. data/spec/fixtures/{rails_users_app → rails5_users_app}/spec/models/user_spec.rb +0 -0
  94. data/spec/fixtures/{rails_users_app → rails5_users_app}/spec/rails_helper.rb +0 -0
  95. data/spec/fixtures/{rails_users_app → rails5_users_app}/spec/spec_helper.rb +0 -0
  96. data/spec/fixtures/{rails_users_app → rails5_users_app}/users_app/.gitignore +0 -0
  97. data/spec/fixtures/rails6_users_app/.dockerignore +1 -0
  98. data/spec/fixtures/rails6_users_app/.gitignore +39 -0
  99. data/spec/fixtures/rails6_users_app/.rspec +1 -0
  100. data/spec/fixtures/{rails_users_app → rails6_users_app}/.ruby-version +0 -0
  101. data/spec/fixtures/rails6_users_app/Dockerfile +29 -0
  102. data/spec/fixtures/rails6_users_app/Dockerfile.pg +3 -0
  103. data/spec/fixtures/{rails_users_app → rails6_users_app}/Gemfile +1 -1
  104. data/spec/fixtures/rails6_users_app/Rakefile +6 -0
  105. data/spec/fixtures/rails6_users_app/app/controllers/api/users_controller.rb +27 -0
  106. data/spec/fixtures/rails6_users_app/app/controllers/application_controller.rb +2 -0
  107. data/spec/fixtures/rails6_users_app/app/controllers/concerns/.keep +0 -0
  108. data/spec/fixtures/rails6_users_app/app/controllers/health_controller.rb +5 -0
  109. data/spec/fixtures/rails6_users_app/app/controllers/users_controller.rb +13 -0
  110. data/spec/fixtures/rails6_users_app/app/models/activerecord/user.rb +18 -0
  111. data/spec/fixtures/rails6_users_app/app/models/concerns/.keep +0 -0
  112. data/spec/fixtures/rails6_users_app/app/models/sequel/user.rb +25 -0
  113. data/spec/fixtures/rails6_users_app/app/views/layouts/application.html.haml +7 -0
  114. data/spec/fixtures/rails6_users_app/app/views/users/index.html.haml +7 -0
  115. data/spec/fixtures/rails6_users_app/appmap.yml +5 -0
  116. data/spec/fixtures/rails6_users_app/bin/appmap +29 -0
  117. data/spec/fixtures/rails6_users_app/bin/byebug +29 -0
  118. data/spec/fixtures/rails6_users_app/bin/gli +29 -0
  119. data/spec/fixtures/rails6_users_app/bin/htmldiff +29 -0
  120. data/spec/fixtures/rails6_users_app/bin/ldiff +29 -0
  121. data/spec/fixtures/rails6_users_app/bin/nokogiri +29 -0
  122. data/spec/fixtures/rails6_users_app/bin/rackup +29 -0
  123. data/spec/fixtures/rails6_users_app/bin/rails +4 -0
  124. data/spec/fixtures/rails6_users_app/bin/rake +29 -0
  125. data/spec/fixtures/rails6_users_app/bin/rspec +29 -0
  126. data/spec/fixtures/rails6_users_app/bin/ruby-parse +29 -0
  127. data/spec/fixtures/rails6_users_app/bin/ruby-rewrite +29 -0
  128. data/spec/fixtures/rails6_users_app/bin/sequel +29 -0
  129. data/spec/fixtures/rails6_users_app/bin/setup +25 -0
  130. data/spec/fixtures/rails6_users_app/bin/sprockets +29 -0
  131. data/spec/fixtures/rails6_users_app/bin/thor +29 -0
  132. data/spec/fixtures/rails6_users_app/bin/update +25 -0
  133. data/spec/fixtures/rails6_users_app/config.ru +5 -0
  134. data/spec/fixtures/rails6_users_app/config/application.rb +51 -0
  135. data/spec/fixtures/rails6_users_app/config/boot.rb +3 -0
  136. data/spec/fixtures/rails6_users_app/config/credentials.yml.enc +1 -0
  137. data/spec/fixtures/rails6_users_app/config/database.yml +18 -0
  138. data/spec/fixtures/rails6_users_app/config/environment.rb +5 -0
  139. data/spec/fixtures/rails6_users_app/config/environments/development.rb +40 -0
  140. data/spec/fixtures/rails6_users_app/config/environments/production.rb +68 -0
  141. data/spec/fixtures/rails6_users_app/config/environments/test.rb +36 -0
  142. data/spec/fixtures/rails6_users_app/config/initializers/application_controller_renderer.rb +8 -0
  143. data/spec/fixtures/rails6_users_app/config/initializers/backtrace_silencers.rb +7 -0
  144. data/spec/fixtures/rails6_users_app/config/initializers/cors.rb +16 -0
  145. data/spec/fixtures/rails6_users_app/config/initializers/filter_parameter_logging.rb +4 -0
  146. data/spec/fixtures/rails6_users_app/config/initializers/inflections.rb +16 -0
  147. data/spec/fixtures/rails6_users_app/config/initializers/mime_types.rb +4 -0
  148. data/spec/fixtures/rails6_users_app/config/initializers/record_button.rb +3 -0
  149. data/spec/fixtures/rails6_users_app/config/initializers/wrap_parameters.rb +9 -0
  150. data/spec/fixtures/rails6_users_app/config/locales/en.yml +33 -0
  151. data/spec/fixtures/rails6_users_app/config/routes.rb +11 -0
  152. data/spec/fixtures/rails6_users_app/create_app +27 -0
  153. data/spec/fixtures/rails6_users_app/db/migrate/20190728211408_create_users.rb +9 -0
  154. data/spec/fixtures/rails6_users_app/db/schema.rb +23 -0
  155. data/spec/fixtures/rails6_users_app/docker-compose.yml +28 -0
  156. data/spec/fixtures/rails6_users_app/features/api_users.feature +13 -0
  157. data/spec/fixtures/rails6_users_app/features/support/env.rb +4 -0
  158. data/spec/fixtures/rails6_users_app/features/support/hooks.rb +11 -0
  159. data/spec/fixtures/rails6_users_app/features/support/steps.rb +18 -0
  160. data/spec/fixtures/rails6_users_app/lib/tasks/.keep +0 -0
  161. data/spec/fixtures/rails6_users_app/log/.keep +0 -0
  162. data/spec/fixtures/rails6_users_app/public/robots.txt +1 -0
  163. data/spec/fixtures/rails6_users_app/spec/controllers/users_controller_api_spec.rb +29 -0
  164. data/spec/fixtures/rails6_users_app/spec/controllers/users_controller_spec.rb +27 -0
  165. data/spec/fixtures/rails6_users_app/spec/models/user_spec.rb +39 -0
  166. data/spec/fixtures/rails6_users_app/spec/rails_helper.rb +66 -0
  167. data/spec/fixtures/rails6_users_app/spec/spec_helper.rb +96 -0
  168. data/spec/fixtures/rails6_users_app/users_app/.gitignore +20 -0
  169. data/spec/hook_spec.rb +103 -22
  170. data/spec/rails_spec_helper.rb +5 -5
  171. data/spec/railtie_spec.rb +31 -32
  172. data/spec/record_sql_rails4_pg_spec.rb +47 -48
  173. data/spec/record_sql_rails_pg_spec.rb +62 -63
  174. data/spec/remote_recording_spec.rb +90 -89
  175. data/spec/rspec_feature_metadata_spec.rb +17 -18
  176. data/test/expectations/openssl_test_key_sign1.json +55 -0
  177. data/test/expectations/openssl_test_key_sign2.json +58 -0
  178. data/test/fixtures/gem_test/Gemfile +6 -0
  179. data/test/fixtures/gem_test/appmap.yml +3 -0
  180. data/test/fixtures/gem_test/test/to_param_test.rb +14 -0
  181. data/test/gem_test.rb +34 -0
  182. data/test/minitest_test.rb +2 -2
  183. data/test/openssl_test.rb +10 -117
  184. metadata +173 -80
  185. data/spec/fixtures/rails_users_app/app/controllers/users_controller.rb +0 -5
  186. data/spec/fixtures/rails_users_app/appmap.yml +0 -3
@@ -0,0 +1,58 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "event": "call",
5
+ "defined_class": "Example",
6
+ "method_id": "sign",
7
+ "path": "lib/openssl_key_sign.rb",
8
+ "lineno": 10,
9
+ "static": true,
10
+ "parameters": [
11
+
12
+ ],
13
+ "receiver": {
14
+ "class": "Module"
15
+ }
16
+ },
17
+ {
18
+ "id": 2,
19
+ "event": "call",
20
+ "defined_class": "OpenSSL::PKey::PKey",
21
+ "method_id": "sign",
22
+ "path": "OpenSSL::PKey::PKey#sign",
23
+ "static": false,
24
+ "parameters": [
25
+ {
26
+ "name": "arg",
27
+ "class": "OpenSSL::Digest::SHA256",
28
+ "value": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
29
+ "kind": "req"
30
+ },
31
+ {
32
+ "name": "arg",
33
+ "class": "String",
34
+ "value": "the document",
35
+ "kind": "req"
36
+ }
37
+ ],
38
+ "receiver": {
39
+ "class": "OpenSSL::PKey::RSA"
40
+ }
41
+ },
42
+ {
43
+ "id": 3,
44
+ "event": "return",
45
+ "parent_id": 2,
46
+ "return_value": {
47
+ "class": "String"
48
+ }
49
+ },
50
+ {
51
+ "id": 4,
52
+ "event": "return",
53
+ "parent_id": 1,
54
+ "return_value": {
55
+ "class": "String"
56
+ }
57
+ }
58
+ ]
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'appmap', git: 'applandinc/appmap-ruby', branch: `git rev-parse --abbrev-ref HEAD`.strip
4
+ gem 'activesupport'
5
+ gem 'byebug'
6
+ gem 'minitest'
@@ -0,0 +1,3 @@
1
+ name: gem_test
2
+ packages:
3
+ - gem: activesupport
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'appmap/minitest'
5
+ require 'minitest/autorun'
6
+ require 'active_support'
7
+ require 'active_support/core_ext'
8
+
9
+ class ToParamTest < ::Minitest::Test
10
+ def test_to_param
11
+ # record use of a core extension
12
+ assert_equal 'my+id', 'my+id'.to_param
13
+ end
14
+ end
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'test_helper'
5
+ require 'English'
6
+
7
+ class MinitestTest < Minitest::Test
8
+ def perform_gem_test(test_name)
9
+ Bundler.with_clean_env do
10
+ Dir.chdir 'test/fixtures/gem_test' do
11
+ FileUtils.rm_rf 'tmp'
12
+ system 'bundle config --local local.appmap ../../..'
13
+ system 'bundle'
14
+ system({ 'APPMAP' => 'true' }, %(bundle exec ruby -Ilib -Itest test/#{test_name}_test.rb))
15
+
16
+ yield
17
+ end
18
+ end
19
+ end
20
+
21
+ def test_record_gem
22
+ perform_gem_test 'to_param' do
23
+ appmap_file = 'tmp/appmap/minitest/To_param_to_param.appmap.json'
24
+ appmap = JSON.parse(File.read(appmap_file))
25
+ events = appmap['events']
26
+ assert_equal 2, events.size
27
+ assert_equal 'call', events.first['event']
28
+ assert_equal 'to_param', events.first['method_id']
29
+ assert_equal "#{Gem.loaded_specs['activesupport'].gem_dir}/lib/active_support/core_ext/object/to_query.rb", events.first['path']
30
+ assert_equal 'return', events.second['event']
31
+ assert_equal 1, events.second['parent_id']
32
+ end
33
+ end
34
+ end
@@ -5,7 +5,7 @@ require 'test_helper'
5
5
  require 'English'
6
6
 
7
7
  class MinitestTest < Minitest::Test
8
- def perform_test(test_name)
8
+ def perform_minitest_test(test_name)
9
9
  Bundler.with_clean_env do
10
10
  Dir.chdir 'test/fixtures/minitest_recorder' do
11
11
  FileUtils.rm_rf 'tmp'
@@ -19,7 +19,7 @@ class MinitestTest < Minitest::Test
19
19
  end
20
20
 
21
21
  def test_hello
22
- perform_test 'hello' do
22
+ perform_minitest_test 'hello' do
23
23
  appmap_file = 'tmp/appmap/minitest/Hello_hello.appmap.json'
24
24
 
25
25
  assert File.file?(appmap_file), 'appmap output file does not exist'
@@ -11,13 +11,17 @@ class OpenSSLTest < Minitest::Test
11
11
  FileUtils.rm_rf 'tmp'
12
12
  system 'bundle config --local local.appmap ../../..'
13
13
  system 'bundle'
14
- system({ 'APPMAP' => 'true', 'DEBUG' => 'true' }, %(bundle exec ruby lib/openssl_#{test_name}.rb))
14
+ system({ 'APPMAP' => 'true' }, %(bundle exec ruby lib/openssl_#{test_name}.rb))
15
15
 
16
16
  yield
17
17
  end
18
18
  end
19
19
  end
20
20
 
21
+ def expectation(name)
22
+ File.read File.join __dir__, 'expectations', name
23
+ end
24
+
21
25
  def test_key_sign
22
26
  perform_test 'key_sign' do
23
27
  appmap_file = 'appmap.json'
@@ -26,62 +30,7 @@ class OpenSSLTest < Minitest::Test
26
30
  appmap = JSON.parse(File.read(appmap_file))
27
31
  assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
28
32
  assert_equal [ { 'recorder' => 'lib/openssl_key_sign.rb' } ], appmap['metadata']
29
- assert_equal JSON.parse(<<~JSON), appmap['classMap']
30
- [
31
- {
32
- "name": "lib",
33
- "type": "package",
34
- "children": [
35
- {
36
- "name": "Example",
37
- "type": "class",
38
- "children": [
39
- {
40
- "name": "sign",
41
- "type": "function",
42
- "location": "lib/openssl_key_sign.rb:10",
43
- "static": true
44
- }
45
- ]
46
- }
47
- ]
48
- },
49
- {
50
- "name": "openssl",
51
- "type": "package",
52
- "children": [
53
- {
54
- "name": "OpenSSL",
55
- "type": "class",
56
- "children": [
57
- {
58
- "name": "PKey",
59
- "type": "class",
60
- "children": [
61
- {
62
- "name": "PKey",
63
- "type": "class",
64
- "children": [
65
- {
66
- "name": "sign",
67
- "type": "function",
68
- "location": "OpenSSL::PKey::PKey#sign",
69
- "static": false,
70
- "labels": [
71
- "security",
72
- "crypto"
73
- ]
74
- }
75
- ]
76
- }
77
- ]
78
- }
79
- ]
80
- }
81
- ]
82
- }
83
- ]
84
- JSON
33
+ assert_equal JSON.parse(expectation('openssl_test_key_sign1.json')), appmap['classMap']
85
34
  sanitized_events = appmap['events'].map(&:deep_symbolize_keys).map(&AppMap::Util.method(:sanitize_event)).map do |event|
86
35
  delete_value = ->(obj) { (obj || {}).delete(:value) }
87
36
  delete_value.call(event[:receiver])
@@ -89,66 +38,10 @@ class OpenSSLTest < Minitest::Test
89
38
  event
90
39
  end
91
40
 
92
- diff = Diffy::Diff.new(<<~JSON.strip, JSON.pretty_generate(sanitized_events).strip)
93
- [
94
- {
95
- "id": 1,
96
- "event": "call",
97
- "defined_class": "Example",
98
- "method_id": "sign",
99
- "path": "lib/openssl_key_sign.rb",
100
- "lineno": 10,
101
- "static": true,
102
- "parameters": [
103
-
104
- ],
105
- "receiver": {
106
- "class": "Module"
107
- }
108
- },
109
- {
110
- "id": 2,
111
- "event": "call",
112
- "defined_class": "OpenSSL::PKey::PKey",
113
- "method_id": "sign",
114
- "path": "OpenSSL::PKey::PKey#sign",
115
- "static": false,
116
- "parameters": [
117
- {
118
- "name": "arg",
119
- "class": "OpenSSL::Digest::SHA256",
120
- "value": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
121
- "kind": "req"
122
- },
123
- {
124
- "name": "arg",
125
- "class": "String",
126
- "value": "the document",
127
- "kind": "req"
128
- }
129
- ],
130
- "receiver": {
131
- "class": "OpenSSL::PKey::RSA"
132
- }
133
- },
134
- {
135
- "id": 3,
136
- "event": "return",
137
- "parent_id": 2,
138
- "return_value": {
139
- "class": "String"
140
- }
141
- },
142
- {
143
- "id": 4,
144
- "event": "return",
145
- "parent_id": 1,
146
- "return_value": {
147
- "class": "String"
148
- }
149
- }
150
- ]
151
- JSON
41
+ diff = Diffy::Diff.new(
42
+ expectation('openssl_test_key_sign2.json').strip,
43
+ JSON.pretty_generate(sanitized_events).strip
44
+ )
152
45
  assert_equal '', diff.to_s
153
46
  end
154
47
  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.35.2
4
+ version: 0.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Gilpin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-01 00:00:00.000000000 Z
11
+ date: 2021-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: method_source
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: parser
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -84,14 +98,14 @@ dependencies:
84
98
  name: bundler
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - "~>"
101
+ - - ">="
88
102
  - !ruby/object:Gem::Version
89
103
  version: '1.16'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - "~>"
108
+ - - ">="
95
109
  - !ruby/object:Gem::Version
96
110
  version: '1.16'
97
111
  - !ruby/object:Gem::Dependency
@@ -290,7 +304,7 @@ dependencies:
290
304
  - - ">="
291
305
  - !ruby/object:Gem::Version
292
306
  version: '0'
293
- description:
307
+ description:
294
308
  email:
295
309
  - kgilpin@gmail.com
296
310
  executables:
@@ -303,7 +317,6 @@ files:
303
317
  - ".gitignore"
304
318
  - ".rbenv-gemsets"
305
319
  - ".rubocop.yml"
306
- - ".ruby-version"
307
320
  - ".travis.yml"
308
321
  - CHANGELOG.md
309
322
  - Dockerfile.appmap
@@ -367,6 +380,7 @@ files:
367
380
  - package.json
368
381
  - spec/abstract_controller4_base_spec.rb
369
382
  - spec/abstract_controller_base_spec.rb
383
+ - spec/class_map_spec.rb
370
384
  - spec/config_spec.rb
371
385
  - spec/fixtures/hook/attr_accessor.rb
372
386
  - spec/fixtures/hook/compare.rb
@@ -446,77 +460,150 @@ files:
446
460
  - spec/fixtures/rails4_users_app/spec/rails_helper.rb
447
461
  - spec/fixtures/rails4_users_app/spec/spec_helper.rb
448
462
  - spec/fixtures/rails4_users_app/test/fixtures/users.yml
449
- - spec/fixtures/rails_users_app/.dockerignore
450
- - spec/fixtures/rails_users_app/.gitignore
451
- - spec/fixtures/rails_users_app/.rspec
452
- - spec/fixtures/rails_users_app/.ruby-version
453
- - spec/fixtures/rails_users_app/Dockerfile
454
- - spec/fixtures/rails_users_app/Dockerfile.pg
455
- - spec/fixtures/rails_users_app/Gemfile
456
- - spec/fixtures/rails_users_app/Rakefile
457
- - spec/fixtures/rails_users_app/app/controllers/api/users_controller.rb
458
- - spec/fixtures/rails_users_app/app/controllers/application_controller.rb
459
- - spec/fixtures/rails_users_app/app/controllers/concerns/.keep
460
- - spec/fixtures/rails_users_app/app/controllers/health_controller.rb
461
- - spec/fixtures/rails_users_app/app/controllers/users_controller.rb
462
- - spec/fixtures/rails_users_app/app/models/activerecord/user.rb
463
- - spec/fixtures/rails_users_app/app/models/concerns/.keep
464
- - spec/fixtures/rails_users_app/app/models/sequel/user.rb
465
- - spec/fixtures/rails_users_app/app/views/layouts/application.html.haml
466
- - spec/fixtures/rails_users_app/app/views/users/index.html.haml
467
- - spec/fixtures/rails_users_app/appmap.yml
468
- - spec/fixtures/rails_users_app/bin/appmap
469
- - spec/fixtures/rails_users_app/bin/byebug
470
- - spec/fixtures/rails_users_app/bin/gli
471
- - spec/fixtures/rails_users_app/bin/htmldiff
472
- - spec/fixtures/rails_users_app/bin/ldiff
473
- - spec/fixtures/rails_users_app/bin/nokogiri
474
- - spec/fixtures/rails_users_app/bin/rackup
475
- - spec/fixtures/rails_users_app/bin/rails
476
- - spec/fixtures/rails_users_app/bin/rake
477
- - spec/fixtures/rails_users_app/bin/rspec
478
- - spec/fixtures/rails_users_app/bin/ruby-parse
479
- - spec/fixtures/rails_users_app/bin/ruby-rewrite
480
- - spec/fixtures/rails_users_app/bin/sequel
481
- - spec/fixtures/rails_users_app/bin/setup
482
- - spec/fixtures/rails_users_app/bin/sprockets
483
- - spec/fixtures/rails_users_app/bin/thor
484
- - spec/fixtures/rails_users_app/bin/update
485
- - spec/fixtures/rails_users_app/config.ru
486
- - spec/fixtures/rails_users_app/config/application.rb
487
- - spec/fixtures/rails_users_app/config/boot.rb
488
- - spec/fixtures/rails_users_app/config/credentials.yml.enc
489
- - spec/fixtures/rails_users_app/config/database.yml
490
- - spec/fixtures/rails_users_app/config/environment.rb
491
- - spec/fixtures/rails_users_app/config/environments/development.rb
492
- - spec/fixtures/rails_users_app/config/environments/production.rb
493
- - spec/fixtures/rails_users_app/config/environments/test.rb
494
- - spec/fixtures/rails_users_app/config/initializers/application_controller_renderer.rb
495
- - spec/fixtures/rails_users_app/config/initializers/backtrace_silencers.rb
496
- - spec/fixtures/rails_users_app/config/initializers/cors.rb
497
- - spec/fixtures/rails_users_app/config/initializers/filter_parameter_logging.rb
498
- - spec/fixtures/rails_users_app/config/initializers/inflections.rb
499
- - spec/fixtures/rails_users_app/config/initializers/mime_types.rb
500
- - spec/fixtures/rails_users_app/config/initializers/record_button.rb
501
- - spec/fixtures/rails_users_app/config/initializers/wrap_parameters.rb
502
- - spec/fixtures/rails_users_app/config/locales/en.yml
503
- - spec/fixtures/rails_users_app/config/routes.rb
504
- - spec/fixtures/rails_users_app/create_app
505
- - spec/fixtures/rails_users_app/db/migrate/20190728211408_create_users.rb
506
- - spec/fixtures/rails_users_app/db/schema.rb
507
- - spec/fixtures/rails_users_app/docker-compose.yml
508
- - spec/fixtures/rails_users_app/features/api_users.feature
509
- - spec/fixtures/rails_users_app/features/support/env.rb
510
- - spec/fixtures/rails_users_app/features/support/hooks.rb
511
- - spec/fixtures/rails_users_app/features/support/steps.rb
512
- - spec/fixtures/rails_users_app/lib/tasks/.keep
513
- - spec/fixtures/rails_users_app/log/.keep
514
- - spec/fixtures/rails_users_app/public/robots.txt
515
- - spec/fixtures/rails_users_app/spec/controllers/users_controller_api_spec.rb
516
- - spec/fixtures/rails_users_app/spec/models/user_spec.rb
517
- - spec/fixtures/rails_users_app/spec/rails_helper.rb
518
- - spec/fixtures/rails_users_app/spec/spec_helper.rb
519
- - spec/fixtures/rails_users_app/users_app/.gitignore
463
+ - spec/fixtures/rails5_users_app/.dockerignore
464
+ - spec/fixtures/rails5_users_app/.gitignore
465
+ - spec/fixtures/rails5_users_app/.rspec
466
+ - spec/fixtures/rails5_users_app/.ruby-version
467
+ - spec/fixtures/rails5_users_app/Dockerfile
468
+ - spec/fixtures/rails5_users_app/Dockerfile.pg
469
+ - spec/fixtures/rails5_users_app/Gemfile
470
+ - spec/fixtures/rails5_users_app/Rakefile
471
+ - spec/fixtures/rails5_users_app/app/controllers/api/users_controller.rb
472
+ - spec/fixtures/rails5_users_app/app/controllers/application_controller.rb
473
+ - spec/fixtures/rails5_users_app/app/controllers/concerns/.keep
474
+ - spec/fixtures/rails5_users_app/app/controllers/health_controller.rb
475
+ - spec/fixtures/rails5_users_app/app/controllers/users_controller.rb
476
+ - spec/fixtures/rails5_users_app/app/models/activerecord/user.rb
477
+ - spec/fixtures/rails5_users_app/app/models/concerns/.keep
478
+ - spec/fixtures/rails5_users_app/app/models/sequel/user.rb
479
+ - spec/fixtures/rails5_users_app/app/views/layouts/application.html.haml
480
+ - spec/fixtures/rails5_users_app/app/views/users/index.html.haml
481
+ - spec/fixtures/rails5_users_app/appmap.yml
482
+ - spec/fixtures/rails5_users_app/bin/appmap
483
+ - spec/fixtures/rails5_users_app/bin/byebug
484
+ - spec/fixtures/rails5_users_app/bin/gli
485
+ - spec/fixtures/rails5_users_app/bin/htmldiff
486
+ - spec/fixtures/rails5_users_app/bin/ldiff
487
+ - spec/fixtures/rails5_users_app/bin/nokogiri
488
+ - spec/fixtures/rails5_users_app/bin/rackup
489
+ - spec/fixtures/rails5_users_app/bin/rails
490
+ - spec/fixtures/rails5_users_app/bin/rake
491
+ - spec/fixtures/rails5_users_app/bin/rspec
492
+ - spec/fixtures/rails5_users_app/bin/ruby-parse
493
+ - spec/fixtures/rails5_users_app/bin/ruby-rewrite
494
+ - spec/fixtures/rails5_users_app/bin/sequel
495
+ - spec/fixtures/rails5_users_app/bin/setup
496
+ - spec/fixtures/rails5_users_app/bin/sprockets
497
+ - spec/fixtures/rails5_users_app/bin/thor
498
+ - spec/fixtures/rails5_users_app/bin/update
499
+ - spec/fixtures/rails5_users_app/config.ru
500
+ - spec/fixtures/rails5_users_app/config/application.rb
501
+ - spec/fixtures/rails5_users_app/config/boot.rb
502
+ - spec/fixtures/rails5_users_app/config/credentials.yml.enc
503
+ - spec/fixtures/rails5_users_app/config/database.yml
504
+ - spec/fixtures/rails5_users_app/config/environment.rb
505
+ - spec/fixtures/rails5_users_app/config/environments/development.rb
506
+ - spec/fixtures/rails5_users_app/config/environments/production.rb
507
+ - spec/fixtures/rails5_users_app/config/environments/test.rb
508
+ - spec/fixtures/rails5_users_app/config/initializers/application_controller_renderer.rb
509
+ - spec/fixtures/rails5_users_app/config/initializers/backtrace_silencers.rb
510
+ - spec/fixtures/rails5_users_app/config/initializers/cors.rb
511
+ - spec/fixtures/rails5_users_app/config/initializers/filter_parameter_logging.rb
512
+ - spec/fixtures/rails5_users_app/config/initializers/inflections.rb
513
+ - spec/fixtures/rails5_users_app/config/initializers/mime_types.rb
514
+ - spec/fixtures/rails5_users_app/config/initializers/record_button.rb
515
+ - spec/fixtures/rails5_users_app/config/initializers/wrap_parameters.rb
516
+ - spec/fixtures/rails5_users_app/config/locales/en.yml
517
+ - spec/fixtures/rails5_users_app/config/routes.rb
518
+ - spec/fixtures/rails5_users_app/create_app
519
+ - spec/fixtures/rails5_users_app/db/migrate/20190728211408_create_users.rb
520
+ - spec/fixtures/rails5_users_app/db/schema.rb
521
+ - spec/fixtures/rails5_users_app/docker-compose.yml
522
+ - spec/fixtures/rails5_users_app/features/api_users.feature
523
+ - spec/fixtures/rails5_users_app/features/support/env.rb
524
+ - spec/fixtures/rails5_users_app/features/support/hooks.rb
525
+ - spec/fixtures/rails5_users_app/features/support/steps.rb
526
+ - spec/fixtures/rails5_users_app/lib/tasks/.keep
527
+ - spec/fixtures/rails5_users_app/log/.keep
528
+ - spec/fixtures/rails5_users_app/public/robots.txt
529
+ - spec/fixtures/rails5_users_app/spec/controllers/users_controller_api_spec.rb
530
+ - spec/fixtures/rails5_users_app/spec/controllers/users_controller_spec.rb
531
+ - spec/fixtures/rails5_users_app/spec/models/user_spec.rb
532
+ - spec/fixtures/rails5_users_app/spec/rails_helper.rb
533
+ - spec/fixtures/rails5_users_app/spec/spec_helper.rb
534
+ - spec/fixtures/rails5_users_app/users_app/.gitignore
535
+ - spec/fixtures/rails6_users_app/.dockerignore
536
+ - spec/fixtures/rails6_users_app/.gitignore
537
+ - spec/fixtures/rails6_users_app/.rspec
538
+ - spec/fixtures/rails6_users_app/.ruby-version
539
+ - spec/fixtures/rails6_users_app/Dockerfile
540
+ - spec/fixtures/rails6_users_app/Dockerfile.pg
541
+ - spec/fixtures/rails6_users_app/Gemfile
542
+ - spec/fixtures/rails6_users_app/Rakefile
543
+ - spec/fixtures/rails6_users_app/app/controllers/api/users_controller.rb
544
+ - spec/fixtures/rails6_users_app/app/controllers/application_controller.rb
545
+ - spec/fixtures/rails6_users_app/app/controllers/concerns/.keep
546
+ - spec/fixtures/rails6_users_app/app/controllers/health_controller.rb
547
+ - spec/fixtures/rails6_users_app/app/controllers/users_controller.rb
548
+ - spec/fixtures/rails6_users_app/app/models/activerecord/user.rb
549
+ - spec/fixtures/rails6_users_app/app/models/concerns/.keep
550
+ - spec/fixtures/rails6_users_app/app/models/sequel/user.rb
551
+ - spec/fixtures/rails6_users_app/app/views/layouts/application.html.haml
552
+ - spec/fixtures/rails6_users_app/app/views/users/index.html.haml
553
+ - spec/fixtures/rails6_users_app/appmap.yml
554
+ - spec/fixtures/rails6_users_app/bin/appmap
555
+ - spec/fixtures/rails6_users_app/bin/byebug
556
+ - spec/fixtures/rails6_users_app/bin/gli
557
+ - spec/fixtures/rails6_users_app/bin/htmldiff
558
+ - spec/fixtures/rails6_users_app/bin/ldiff
559
+ - spec/fixtures/rails6_users_app/bin/nokogiri
560
+ - spec/fixtures/rails6_users_app/bin/rackup
561
+ - spec/fixtures/rails6_users_app/bin/rails
562
+ - spec/fixtures/rails6_users_app/bin/rake
563
+ - spec/fixtures/rails6_users_app/bin/rspec
564
+ - spec/fixtures/rails6_users_app/bin/ruby-parse
565
+ - spec/fixtures/rails6_users_app/bin/ruby-rewrite
566
+ - spec/fixtures/rails6_users_app/bin/sequel
567
+ - spec/fixtures/rails6_users_app/bin/setup
568
+ - spec/fixtures/rails6_users_app/bin/sprockets
569
+ - spec/fixtures/rails6_users_app/bin/thor
570
+ - spec/fixtures/rails6_users_app/bin/update
571
+ - spec/fixtures/rails6_users_app/config.ru
572
+ - spec/fixtures/rails6_users_app/config/application.rb
573
+ - spec/fixtures/rails6_users_app/config/boot.rb
574
+ - spec/fixtures/rails6_users_app/config/credentials.yml.enc
575
+ - spec/fixtures/rails6_users_app/config/database.yml
576
+ - spec/fixtures/rails6_users_app/config/environment.rb
577
+ - spec/fixtures/rails6_users_app/config/environments/development.rb
578
+ - spec/fixtures/rails6_users_app/config/environments/production.rb
579
+ - spec/fixtures/rails6_users_app/config/environments/test.rb
580
+ - spec/fixtures/rails6_users_app/config/initializers/application_controller_renderer.rb
581
+ - spec/fixtures/rails6_users_app/config/initializers/backtrace_silencers.rb
582
+ - spec/fixtures/rails6_users_app/config/initializers/cors.rb
583
+ - spec/fixtures/rails6_users_app/config/initializers/filter_parameter_logging.rb
584
+ - spec/fixtures/rails6_users_app/config/initializers/inflections.rb
585
+ - spec/fixtures/rails6_users_app/config/initializers/mime_types.rb
586
+ - spec/fixtures/rails6_users_app/config/initializers/record_button.rb
587
+ - spec/fixtures/rails6_users_app/config/initializers/wrap_parameters.rb
588
+ - spec/fixtures/rails6_users_app/config/locales/en.yml
589
+ - spec/fixtures/rails6_users_app/config/routes.rb
590
+ - spec/fixtures/rails6_users_app/create_app
591
+ - spec/fixtures/rails6_users_app/db/migrate/20190728211408_create_users.rb
592
+ - spec/fixtures/rails6_users_app/db/schema.rb
593
+ - spec/fixtures/rails6_users_app/docker-compose.yml
594
+ - spec/fixtures/rails6_users_app/features/api_users.feature
595
+ - spec/fixtures/rails6_users_app/features/support/env.rb
596
+ - spec/fixtures/rails6_users_app/features/support/hooks.rb
597
+ - spec/fixtures/rails6_users_app/features/support/steps.rb
598
+ - spec/fixtures/rails6_users_app/lib/tasks/.keep
599
+ - spec/fixtures/rails6_users_app/log/.keep
600
+ - spec/fixtures/rails6_users_app/public/robots.txt
601
+ - spec/fixtures/rails6_users_app/spec/controllers/users_controller_api_spec.rb
602
+ - spec/fixtures/rails6_users_app/spec/controllers/users_controller_spec.rb
603
+ - spec/fixtures/rails6_users_app/spec/models/user_spec.rb
604
+ - spec/fixtures/rails6_users_app/spec/rails_helper.rb
605
+ - spec/fixtures/rails6_users_app/spec/spec_helper.rb
606
+ - spec/fixtures/rails6_users_app/users_app/.gitignore
520
607
  - spec/hook_spec.rb
521
608
  - spec/open_spec.rb
522
609
  - spec/rails_spec_helper.rb
@@ -529,6 +616,8 @@ files:
529
616
  - spec/util_spec.rb
530
617
  - test/cli_test.rb
531
618
  - test/cucumber_test.rb
619
+ - test/expectations/openssl_test_key_sign1.json
620
+ - test/expectations/openssl_test_key_sign2.json
532
621
  - test/fixtures/cli_record_test/appmap.yml
533
622
  - test/fixtures/cli_record_test/lib/cli_record_test/main.rb
534
623
  - test/fixtures/cucumber4_recorder/Gemfile
@@ -545,6 +634,9 @@ files:
545
634
  - test/fixtures/cucumber_recorder/features/support/hooks.rb
546
635
  - test/fixtures/cucumber_recorder/features/support/steps.rb
547
636
  - test/fixtures/cucumber_recorder/lib/hello.rb
637
+ - test/fixtures/gem_test/Gemfile
638
+ - test/fixtures/gem_test/appmap.yml
639
+ - test/fixtures/gem_test/test/to_param_test.rb
548
640
  - test/fixtures/minitest_recorder/Gemfile
549
641
  - test/fixtures/minitest_recorder/appmap.yml
550
642
  - test/fixtures/minitest_recorder/lib/hello.rb
@@ -562,6 +654,7 @@ files:
562
654
  - test/fixtures/rspec_recorder/spec/decorated_hello_spec.rb
563
655
  - test/fixtures/rspec_recorder/spec/labeled_hello_spec.rb
564
656
  - test/fixtures/rspec_recorder/spec/plain_hello_spec.rb
657
+ - test/gem_test.rb
565
658
  - test/minitest_test.rb
566
659
  - test/openssl_test.rb
567
660
  - test/record_process_test.rb
@@ -571,7 +664,7 @@ homepage: https://github.com/applandinc/appmap-ruby
571
664
  licenses:
572
665
  - MIT
573
666
  metadata: {}
574
- post_install_message:
667
+ post_install_message:
575
668
  rdoc_options: []
576
669
  require_paths:
577
670
  - lib
@@ -587,7 +680,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
587
680
  version: '0'
588
681
  requirements: []
589
682
  rubygems_version: 3.0.3
590
- signing_key:
683
+ signing_key:
591
684
  specification_version: 4
592
685
  summary: Record the operation of a Ruby program, using the AppLand 'AppMap' format.
593
686
  test_files: []