appmap 0.80.2 → 0.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52ebea9f89c7f412123ff2473f0ed62f46f2be4e69e98574d59c3eb91f8ef29b
4
- data.tar.gz: 823073540b9979ede52b30c0e70398894b284bf51d10fcce786f082258d363c8
3
+ metadata.gz: 9823b1057cc7274ca130a8cfd86983fa837e340563024dce3363aa4f79b2ef88
4
+ data.tar.gz: fdf4e2dc117b62626e4a3b844505bc8d73119ca221159362a9ba822c5e64b56a
5
5
  SHA512:
6
- metadata.gz: f837ad0b0ac7520c36c4ba2aa1c2d897235d316068461019a77a826dac5e8bf1401f44815d9cfb4fb47194c7b9090c70f3936073e1e99f0c7124fa9fe1d6baac
7
- data.tar.gz: abb39a31ffd07bdccb0f5835cdd69bf5bacd5eb0844ea8836995017fe41716560243d1629bed2ed9fce046636586d35a17dc6abaaa5286d8532e41a3ad94f5ec
6
+ metadata.gz: e7b445107174000b6e01c04bc75ffcb5e46457f458949a354d6a455e721f21c5592279018f0eb3ba8bf4f3f476c47db9196d14bc6a8d629e5715b02c535f31c9
7
+ data.tar.gz: cdaa148278c0c6c3289e488332e280eac5b786728bd27f514a2f5e38bc01b2eaeb19f837cf74f251987402e10fc083de77c170abf5360145fef3d6c23d0955a7
data/.travis.yml CHANGED
@@ -4,9 +4,8 @@ cache:
4
4
  - bundle
5
5
  - yarn
6
6
 
7
- # NB: if you update the ruby versions here, you also need to update
8
- # them in the Rakefile.
9
7
  rbenv:
8
+ - 2.5
10
9
  - 2.6
11
10
  - 2.7
12
11
  - 3.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ # [0.82.0](https://github.com/applandinc/appmap-ruby/compare/v0.81.1...v0.82.0) (2022-04-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Guess 'app' as the source path ([090f9f3](https://github.com/applandinc/appmap-ruby/commit/090f9f39616accd3bc1e9d3cc5f7991232fe5663))
7
+
8
+
9
+ ### Features
10
+
11
+ * install command emits language, appmap_dir ([f780095](https://github.com/applandinc/appmap-ruby/commit/f780095269352e30637de3300dd76b2d6c051022))
12
+
13
+ ## [0.81.1](https://github.com/applandinc/appmap-ruby/compare/v0.81.0...v0.81.1) (2022-04-27)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * AppMap format version is 1.7.0 ([53b3f04](https://github.com/applandinc/appmap-ruby/commit/53b3f04dc4f4a7867f28f5b196b2fadbe7cb6eeb))
19
+ * Avoid return within a block (Ruby 2.5) ([85094fd](https://github.com/applandinc/appmap-ruby/commit/85094fd760b3ea08d343960cf586f4cce210fb07))
20
+
21
+ # [0.81.0](https://github.com/applandinc/appmap-ruby/compare/v0.80.2...v0.81.0) (2022-04-26)
22
+
23
+
24
+ ### Features
25
+
26
+ * Add Ruby 2.5 to the version whitelist ([945f7da](https://github.com/applandinc/appmap-ruby/commit/945f7daaee9685a55f14e8714677661fa5cb4e82))
27
+
1
28
  ## [0.80.2](https://github.com/applandinc/appmap-ruby/compare/v0.80.1...v0.80.2) (2022-04-26)
2
29
 
3
30
 
@@ -13,7 +13,9 @@ module AppMap
13
13
  def perform
14
14
  config = {
15
15
  'name' => Service::Guesser.guess_name,
16
- 'packages' => Service::Guesser.guess_paths.map { |path| { 'path' => path } }
16
+ 'packages' => Service::Guesser.guess_paths.map { |path| { 'path' => path } },
17
+ 'language' => 'ruby',
18
+ 'appmap_dir' => 'tmp/appmap'
17
19
  }
18
20
 
19
21
  result = {
data/lib/appmap/hook.rb CHANGED
@@ -116,7 +116,7 @@ module AppMap
116
116
 
117
117
  hook_method = lambda do |entry|
118
118
  cls, method = entry
119
- return false if config.never_hook?(cls, method)
119
+ next if config.never_hook?(cls, method)
120
120
 
121
121
  hook.package.handler_class.new(hook.package, cls, method).activate
122
122
  end
data/lib/appmap/open.rb CHANGED
@@ -38,7 +38,7 @@ module AppMap
38
38
  Thread.new do
39
39
  Rack::Handler::WEBrick.run(
40
40
  lambda do |env|
41
- return [200, { 'Content-Type' => 'text/html' }, [page]]
41
+ [200, { 'Content-Type' => 'text/html' }, [page]]
42
42
  end,
43
43
  :Port => 0
44
44
  ) do |server|
@@ -23,6 +23,11 @@ module AppMap
23
23
  config_validator.valid?
24
24
  end
25
25
 
26
+ def errors
27
+ valid?
28
+ config_validator.violations.map(&:message)
29
+ end
30
+
26
31
  private
27
32
 
28
33
  def config_validator
@@ -3,10 +3,11 @@
3
3
  module AppMap
4
4
  module Service
5
5
  class Guesser
6
- POSSIBLE_PATHS = %w[app/controllers app/models lib]
6
+ POSSIBLE_PATHS = %w[app lib]
7
7
  class << self
8
8
  def guess_name
9
9
  return Pathname.new(`git rev-parse --show-toplevel`.strip).basename.to_s if File.directory?('.git')
10
+
10
11
  Dir.pwd.split('/').last
11
12
  end
12
13
 
@@ -19,6 +19,7 @@ module AppMap
19
19
  end
20
20
 
21
21
  def valid?
22
+ @violations = []
22
23
  validate_ruby_version
23
24
  validate_rails_presence
24
25
  validate_config_presence
@@ -3,11 +3,11 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.80.2'
6
+ VERSION = '0.82.0'
7
7
 
8
- APPMAP_FORMAT_VERSION = '1.5.1'
8
+ APPMAP_FORMAT_VERSION = '1.7.0'
9
9
 
10
- SUPPORTED_RUBY_VERSIONS = %w[2.6 2.7 3.0 3.1].freeze
10
+ SUPPORTED_RUBY_VERSIONS = %w[2.5 2.6 2.7 3.0 3.1].freeze
11
11
 
12
12
  DEFAULT_APPMAP_DIR = 'tmp/appmap'.freeze
13
13
  DEFAULT_CONFIG_FILE_PATH = 'appmap.yml'.freeze
@@ -110,12 +110,14 @@ describe 'Depends API' do
110
110
 
111
111
  describe 'smoke test' do
112
112
  around do |test|
113
- @minitest_test_command_method = AppMap.configuration.depends_config.minitest_test_command_method
114
- AppMap.configuration.depends_config.minitest_test_command_method = 'AppMap::Depends::APISpec.minitest_test_command'
113
+ begin
114
+ @minitest_test_command_method = AppMap.configuration.depends_config.minitest_test_command_method
115
+ AppMap.configuration.depends_config.minitest_test_command_method = 'AppMap::Depends::APISpec.minitest_test_command'
115
116
 
116
- test.call
117
- ensure
118
- AppMap.configuration.depends_config.minitest_test_command_method = @minitest_test_command
117
+ test.call
118
+ ensure
119
+ AppMap.configuration.depends_config.minitest_test_command_method = @minitest_test_command
120
+ end
119
121
  end
120
122
 
121
123
  it 'passes a smoke test' do
@@ -125,20 +127,22 @@ describe 'Depends API' do
125
127
 
126
128
  describe 'configuration settings' do
127
129
  it 'can all be modified' do
128
- defaults = {}
129
-
130
- %i[rspec minitest].each do |framework|
131
- %i[environment_method select_tests_method test_command_method].each do |setting|
132
- full_setting = [ framework, setting ].join('_').to_sym
133
- defaults[full_setting] = AppMap.configuration.depends_config.send(full_setting)
134
- AppMap.configuration.depends_config.send("#{full_setting}=", "AppMap::Depends::APISpec.#{full_setting}")
130
+ begin
131
+ defaults = {}
132
+
133
+ %i[rspec minitest].each do |framework|
134
+ %i[environment_method select_tests_method test_command_method].each do |setting|
135
+ full_setting = [ framework, setting ].join('_').to_sym
136
+ defaults[full_setting] = AppMap.configuration.depends_config.send(full_setting)
137
+ AppMap.configuration.depends_config.send("#{full_setting}=", "AppMap::Depends::APISpec.#{full_setting}")
138
+ end
135
139
  end
136
- end
137
140
 
138
- run_tests
139
- ensure
140
- defaults.keys.each do |setting|
141
- AppMap.configuration.depends_config.send("#{setting}=", defaults[setting])
141
+ run_tests
142
+ ensure
143
+ defaults.keys.each do |setting|
144
+ AppMap.configuration.depends_config.send("#{setting}=", defaults[setting])
145
+ end
142
146
  end
143
147
  end
144
148
  end
@@ -0,0 +1,14 @@
1
+ name: appmap
2
+ packages:
3
+ - path: app/models
4
+ exclude: app/models/helpers
5
+ - gem: rack
6
+ - gem: activesupport
7
+ shallow: false
8
+ functions:
9
+ - methods:
10
+ - OpenSSL::X509::Request#sign
11
+ - OpenSSL::X509::Request#verify
12
+ label: crypto.x509
13
+ language: ruby
14
+ appmap_dir: tmp/appmap
@@ -1,3 +1,3 @@
1
1
  name: appmap
2
2
  packages:
3
- - path: app/models
3
+ - path: app/models
@@ -38,7 +38,7 @@ describe 'AppMap::Handler::Eval' do
38
38
  # a la Ruby 2.6.3 ruby-token.rb
39
39
  # token_c = eval("class #{token_n} < #{super_token}; end; #{token_n}")
40
40
  it 'can define a new class' do
41
- num = (Random.random_number * 10_000).to_i
41
+ num = (Random.new.random_number * 10_000).to_i
42
42
  class_name = "Cls_#{num}"
43
43
  m = ClassMaker
44
44
  cls = nil
data/spec/hook_spec.rb CHANGED
@@ -751,9 +751,11 @@ describe 'AppMap class Hooking' do
751
751
  :lineno: 9
752
752
  YAML
753
753
  test_hook_behavior 'spec/fixtures/hook/exception_method.rb', events_yaml do
754
- ExceptionMethod.new.raise_exception
755
- rescue
756
- # don't let the exception fail the test
754
+ begin
755
+ ExceptionMethod.new.raise_exception
756
+ rescue
757
+ # don't let the exception fail the test
758
+ end
757
759
  end
758
760
  end
759
761
 
@@ -781,9 +783,11 @@ describe 'AppMap class Hooking' do
781
783
  :lineno: 59
782
784
  YAML
783
785
  test_hook_behavior 'spec/fixtures/hook/exception_method.rb', events_yaml do
784
- ExceptionMethod.new.raise_illegal_utf8_message
785
- rescue
786
- # don't let the exception fail the test
786
+ begin
787
+ ExceptionMethod.new.raise_illegal_utf8_message
788
+ rescue
789
+ # don't let the exception fail the test
790
+ end
787
791
  end
788
792
  end
789
793
 
@@ -18,7 +18,7 @@ class TestRailsApp
18
18
  attr_reader :fixture_dir
19
19
 
20
20
  def run_cmd(cmd, env = {})
21
- run_process method(:system), cmd, env, exception: true
21
+ run_process method(:system), cmd, env
22
22
  end
23
23
 
24
24
  def spawn_cmd(cmd, env = {})
@@ -33,7 +33,7 @@ class TestRailsApp
33
33
 
34
34
  def database_name
35
35
  # This is used locally too, so make the name nice and unique.
36
- @database_name ||= "appland-rails-test-#{Random.bytes(8).unpack1('h*')}"
36
+ @database_name ||= "appland-rails-test-#{Random.new.bytes(8).unpack1('h*')}"
37
37
  end
38
38
 
39
39
  def bundle
@@ -18,10 +18,12 @@ describe 'remote recording', :order => :defined do
18
18
  uri = URI("http://localhost:#{@service_port}/health")
19
19
 
20
20
  100.times do
21
- Net::HTTP.get(uri)
22
- break
23
- rescue Errno::ECONNREFUSED
24
- sleep 0.1
21
+ begin
22
+ Net::HTTP.get(uri)
23
+ break
24
+ rescue Errno::ECONNREFUSED
25
+ sleep 0.1
26
+ end
25
27
  end
26
28
  end
27
29
 
@@ -37,10 +37,8 @@ describe AppMap::Service::ConfigAnalyzer do
37
37
  end
38
38
  end
39
39
 
40
- describe '.is_valid?' do
41
- it 'returns true' do
42
- expect(subject.valid?).to be_falsey
43
- end
40
+ it 'is valid' do
41
+ expect(subject.errors).to eq(['AppMap auto-configuration is currently not available for non Rails projects'])
44
42
  end
45
43
 
46
44
  describe '.is_present?' do
@@ -50,6 +48,14 @@ describe AppMap::Service::ConfigAnalyzer do
50
48
  end
51
49
  end
52
50
 
51
+ context 'with maximal valid config' do
52
+ let(:config_file) { 'spec/fixtures/config/maximal_config.yml'}
53
+
54
+ it 'is valid' do
55
+ expect(subject.errors).to eq(['AppMap auto-configuration is currently not available for non Rails projects'])
56
+ end
57
+ end
58
+
53
59
  context 'with invalid YAML config' do
54
60
  let(:config_file) { 'spec/fixtures/config/invalid_yaml_config.yml'}
55
61
 
@@ -9,6 +9,8 @@ class AgentSetupInitTest < Minitest::Test
9
9
  name: appmap-ruby
10
10
  packages:
11
11
  - path: lib
12
+ language: ruby
13
+ appmap_dir: tmp/appmap
12
14
  )
13
15
 
14
16
  def test_init_when_config_exists
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.80.2
4
+ version: 0.82.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Gilpin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-26 00:00:00.000000000 Z
11
+ date: 2022-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -435,6 +435,7 @@ files:
435
435
  - spec/fixtures/config/incomplete_config.yml
436
436
  - spec/fixtures/config/invalid_config.yml
437
437
  - spec/fixtures/config/invalid_yaml_config.yml
438
+ - spec/fixtures/config/maximal_config.yml
438
439
  - spec/fixtures/config/missing_path_or_gem.yml
439
440
  - spec/fixtures/config/valid_config.yml
440
441
  - spec/fixtures/database.yml