appmap 0.93.3 → 0.93.5

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: 21061232aa6830335a8a3861f1f646cf30a1fc7b4817689dddcc95ff88fd9055
4
- data.tar.gz: dfd9dd996ac35e5648f3d8b48610b3e0944e321128f533631d00a1e6bb2fff5a
3
+ metadata.gz: e06f80a7364f75faaa0a8838b5053ea147349c3737b4072003aef809e6e2bbec
4
+ data.tar.gz: 004e1d57ebe2a8c1aa718062cec50d1846526e12b6cd014b7780cbb636417500
5
5
  SHA512:
6
- metadata.gz: ec3b00c06f9ecfc143c3deaa926e4740a1bd2b152dc4ab2b4d52802a0d420454281b34f10fad994c318a5b3013239337c238edfe3b4b29c2f912cb07db664eed
7
- data.tar.gz: 546db9702fd815c56bb5da540eae30b20bbd67ade8b05b8a7c6aec1ee4e052ab2a596ba812bc2ebcf4d53ab1c3ebec35b78dc41edd870954c48ce510eeae66f9
6
+ metadata.gz: 524637c14e1fb40dc5d8174af904adf7f5f72827d8c2c61689e612602d1d9a15464697ec65c207d295e7a9752af9bdaeedab26ff515e2db3f324bec4bc3de97a
7
+ data.tar.gz: 2239720d8ede87ba270e57299dfd63842eee3e07d9426249d647cbcc48095ba6439d796f090b5ab55fd76ba62afd8c3117944db067180d5d0628c9e19fed30e5
data/.rubocop.yml CHANGED
@@ -14,6 +14,9 @@ Layout/CaseIndentation:
14
14
  Layout/FirstArgumentIndentation:
15
15
  EnforcedStyle: consistent
16
16
 
17
+ Layout/FirstArrayElementIndentation:
18
+ EnforcedStyle: consistent
19
+
17
20
  Layout/SpaceInsideArrayLiteralBrackets:
18
21
  Enabled: false
19
22
 
data/.travis.yml CHANGED
@@ -10,15 +10,11 @@ rbenv:
10
10
  - 3.0
11
11
  - 3.1
12
12
 
13
+ node_js: lts/*
14
+
13
15
  services:
14
16
  - postgresql
15
17
 
16
- before_install:
17
- - |
18
- nvm install --lts \
19
- && nvm use --lts \
20
- && npm i -g yarn
21
-
22
18
  before_deploy:
23
19
  - |
24
20
  npm i -g \
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [0.93.5](https://github.com/getappmap/appmap-ruby/compare/v0.93.4...v0.93.5) (2022-11-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Only show a warning in non-Rails projects ([4ed86c7](https://github.com/getappmap/appmap-ruby/commit/4ed86c705ea0183940714af47bdda81917ad3f92)), closes [#292](https://github.com/getappmap/appmap-ruby/issues/292)
7
+
8
+ ## [0.93.4](https://github.com/getappmap/appmap-ruby/compare/v0.93.3...v0.93.4) (2022-11-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Use correct signature for Init_appmap() in appmap.c ([1157085](https://github.com/getappmap/appmap-ruby/commit/11570859a1fedd2e1cc7004d291ae8fecd23714a))
14
+
1
15
  ## [0.93.3](https://github.com/getappmap/appmap-ruby/compare/v0.93.2...v0.93.3) (2022-10-11)
2
16
 
3
17
 
data/ext/appmap/appmap.c CHANGED
@@ -101,7 +101,7 @@ am_previous_bindings(VALUE self, VALUE level)
101
101
  return rb_debug_inspector_open(bindings_callback, (void *) level);
102
102
  }
103
103
 
104
- void Init_appmap() {
104
+ void Init_appmap(void) {
105
105
  VALUE appmap = rb_define_module("AppMap");
106
106
  am_AppMapHook = rb_define_class_under(appmap, "Hook", rb_cObject);
107
107
 
@@ -14,7 +14,7 @@ module AppMap
14
14
  schema = YAML.safe_load(File.read(schema_path))
15
15
  result = {
16
16
  version: 2,
17
- errors: config_validator.valid? ? [] : config_validator.violations.map(&:to_h),
17
+ errors: config_validator.violations.map(&:to_h),
18
18
  schema: schema
19
19
  }
20
20
  puts JSON.pretty_generate(result)
@@ -25,7 +25,11 @@ module AppMap
25
25
 
26
26
  def errors
27
27
  valid?
28
- config_validator.violations.map(&:message)
28
+ config_validator.violations.filter(&:error?).map(&:message)
29
+ end
30
+
31
+ def warnings
32
+ config_validator.violations.filter(&:warning?).map(&:message)
29
33
  end
30
34
 
31
35
  private
@@ -7,8 +7,6 @@ module AppMap
7
7
  module Service
8
8
  module Validator
9
9
  class ConfigValidator
10
- attr_reader :violations
11
-
12
10
  def initialize(config_file)
13
11
  @config_file = config_file
14
12
  @violations = []
@@ -19,17 +17,29 @@ module AppMap
19
17
  end
20
18
 
21
19
  def valid?
20
+ validate
21
+ @violations.none?(&:error?)
22
+ end
23
+
24
+ def violations
25
+ validate
26
+ @violations
27
+ end
28
+
29
+ private
30
+
31
+ def validate
32
+ return if @validated
33
+
22
34
  @violations = []
23
35
  validate_ruby_version
24
36
  validate_rails_presence
25
37
  validate_config_presence
26
38
  parse_config
27
39
  validate_config_load
28
- @violations.empty?
40
+ @validated = true
29
41
  end
30
42
 
31
- private
32
-
33
43
  def present?
34
44
  File.exist?(@config_file)
35
45
  end
@@ -71,8 +81,10 @@ module AppMap
71
81
 
72
82
  def validate_rails_presence
73
83
  unless Gem.loaded_specs.has_key?('rails')
74
- @violations << Violation.error(
75
- message: 'AppMap auto-configuration is currently not available for non Rails projects'
84
+ @violations << Violation.warning(
85
+ message: "This is not a Rails project. AppMap won't be automatically loaded.",
86
+ detailed_message: "Please ensure you `require 'appmap'` in your test environment.",
87
+ help_urls: [ 'https://appmap.io/docs/reference/appmap-ruby#tests-recording' ]
76
88
  )
77
89
  end
78
90
  end
@@ -44,6 +44,14 @@ module AppMap
44
44
  hash[var.to_s.delete("@")] = self.instance_variable_get(var)
45
45
  end.compact
46
46
  end
47
+
48
+ def error?
49
+ @level == :error
50
+ end
51
+
52
+ def warning?
53
+ @level == :warning
54
+ end
47
55
  end
48
56
  end
49
57
  end
@@ -3,7 +3,7 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.93.3'
6
+ VERSION = '0.93.5'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.9.0'
9
9
 
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.93.3
4
+ version: 0.93.5
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-10-11 00:00:00.000000000 Z
11
+ date: 2022-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: method_source