appmap 0.56.0 → 0.57.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/appmap/command/agent_setup/init.rb +8 -22
- data/lib/appmap/version.rb +1 -1
- data/test/agent_setup_init_test.rb +16 -16
- 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: 442ca8673e42cd8bea0db1ba97a533e7a38965f3d27707bd8e4379b578ee85cb
|
4
|
+
data.tar.gz: 1174d299f1446c8c3e16403437682196ce794bad27b7c6dd69d712f9bd59e36a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73bb23b5ac1401565c57ffbd833fe266ddebfe71271926ca0afaa08b92c88ffd47f5c92f6e91f213b8066729e6607a1b0f99731449eecf7bd68ab125a0f5de3f
|
7
|
+
data.tar.gz: f72d956ed6c6a46aebe12724a910d5cbdec1aee3d8b61f300e8b2a679873b25db245cca4407c02a03df1588fd3734d616472aed69c2741898e60bc04f6d04b33
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [0.57.0](https://github.com/applandinc/appmap-ruby/compare/v0.56.0...v0.57.0) (2021-06-29)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* Update init command to return JSON ([1f93e89](https://github.com/applandinc/appmap-ruby/commit/1f93e8909684e1018f513d69adfde2a5d0bf6bc9))
|
7
|
+
|
1
8
|
# [0.56.0](https://github.com/applandinc/appmap-ruby/compare/v0.55.0...v0.56.0) (2021-06-28)
|
2
9
|
|
3
10
|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'json'
|
4
4
|
require 'appmap/service/guesser'
|
5
|
-
require 'appmap/util'
|
6
5
|
|
7
6
|
module AppMap
|
8
7
|
module Command
|
@@ -11,32 +10,19 @@ module AppMap
|
|
11
10
|
|
12
11
|
class Init < InitStruct
|
13
12
|
def perform
|
14
|
-
if File.exist?(config_file)
|
15
|
-
puts AppMap::Util.color(%(The AppMap config file #{config_file} already exists.), :magenta)
|
16
|
-
return
|
17
|
-
end
|
18
|
-
|
19
|
-
ensure_directory_exists
|
20
|
-
|
21
13
|
config = {
|
22
14
|
'name' => Service::Guesser.guess_name,
|
23
15
|
'packages' => Service::Guesser.guess_paths.map { |path| { 'path' => path } }
|
24
16
|
}
|
25
|
-
content = YAML.dump(config).gsub("---\n", '')
|
26
17
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
18
|
+
result = {
|
19
|
+
configuration: {
|
20
|
+
filename: config_file,
|
21
|
+
contents: YAML.dump(config)
|
22
|
+
}
|
23
|
+
}
|
36
24
|
|
37
|
-
|
38
|
-
dirname = File.dirname(config_file)
|
39
|
-
FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
|
25
|
+
puts JSON.pretty_generate(result)
|
40
26
|
end
|
41
27
|
end
|
42
28
|
end
|
data/lib/appmap/version.rb
CHANGED
@@ -5,8 +5,8 @@ require 'test_helper'
|
|
5
5
|
|
6
6
|
class AgentSetupInitTest < Minitest::Test
|
7
7
|
CONFIG_FILENAME = '123.yml'
|
8
|
-
|
9
|
-
|
8
|
+
EXPECTED_CONFIG_CONTENT = %(---
|
9
|
+
name: appmap-ruby
|
10
10
|
packages:
|
11
11
|
- path: lib
|
12
12
|
)
|
@@ -14,24 +14,24 @@ packages:
|
|
14
14
|
def test_init_when_config_exists
|
15
15
|
output = `./exe/appmap-agent-init`
|
16
16
|
assert_equal 0, $CHILD_STATUS.exitstatus
|
17
|
-
|
17
|
+
expected = JSON.pretty_generate({
|
18
|
+
configuration: {
|
19
|
+
filename: 'appmap.yml',
|
20
|
+
contents: EXPECTED_CONFIG_CONTENT
|
21
|
+
}
|
22
|
+
})
|
23
|
+
assert_equal expected, output.strip
|
18
24
|
end
|
19
25
|
|
20
26
|
def test_init_with_custom_config_filename
|
21
27
|
output = `./exe/appmap-agent-init -c #{CONFIG_FILENAME}`
|
22
28
|
assert_equal 0, $CHILD_STATUS.exitstatus
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
output = `./exe/appmap-agent-init --config=#{SUBFOLDER_CONFIG_FILEPATH}`
|
31
|
-
assert_equal 0, $CHILD_STATUS.exitstatus
|
32
|
-
assert_includes output, "The following AppMap config file #{SUBFOLDER_CONFIG_FILEPATH} has been created:"
|
33
|
-
assert_equal EXPECTED_CONFIG_CONTENT, File.read(SUBFOLDER_CONFIG_FILEPATH)
|
34
|
-
ensure
|
35
|
-
File.delete(SUBFOLDER_CONFIG_FILEPATH) if File.exist?(SUBFOLDER_CONFIG_FILEPATH)
|
29
|
+
expected = JSON.pretty_generate({
|
30
|
+
configuration: {
|
31
|
+
filename: CONFIG_FILENAME,
|
32
|
+
contents: EXPECTED_CONFIG_CONTENT
|
33
|
+
}
|
34
|
+
})
|
35
|
+
assert_equal expected, output.strip
|
36
36
|
end
|
37
37
|
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.
|
4
|
+
version: 0.57.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: 2021-06-
|
11
|
+
date: 2021-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|