appmap 0.56.0 → 0.57.0

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: 1cfb7d49bd076c0599f8b4866cee8475109553812d13be58a873a288391f9f25
4
- data.tar.gz: 2cc00cb780ac948e058ca4742ce3bc52d79b8c08f55bcf964363a9f1fcfc2763
3
+ metadata.gz: 442ca8673e42cd8bea0db1ba97a533e7a38965f3d27707bd8e4379b578ee85cb
4
+ data.tar.gz: 1174d299f1446c8c3e16403437682196ce794bad27b7c6dd69d712f9bd59e36a
5
5
  SHA512:
6
- metadata.gz: acf4df227c1cadc89495c36528eb386f1a09323010dba9869a8a1e7d4b584bf2097a7148a57fe0ca0979560a30cb5f083cf132f799f309a1ef89461025151558
7
- data.tar.gz: 628153961f02ad5cb6b34e3ac21432afdce20a61234f3dfa9b57835e33ef5189d9a10c12ba4d361126e820ecd6dd3b89b8b64f2f72a5e1f6d38ee3ea4e5888a9
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 'fileutils'
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
- File.write(config_file, content)
28
- puts AppMap::Util.color(
29
- %(The following AppMap config file #{config_file} has been created:),
30
- :green
31
- )
32
- puts content
33
- end
34
-
35
- private
18
+ result = {
19
+ configuration: {
20
+ filename: config_file,
21
+ contents: YAML.dump(config)
22
+ }
23
+ }
36
24
 
37
- def ensure_directory_exists
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
@@ -3,7 +3,7 @@
3
3
  module AppMap
4
4
  URL = 'https://github.com/applandinc/appmap-ruby'
5
5
 
6
- VERSION = '0.56.0'
6
+ VERSION = '0.57.0'
7
7
 
8
8
  APPMAP_FORMAT_VERSION = '1.5.1'
9
9
 
@@ -5,8 +5,8 @@ require 'test_helper'
5
5
 
6
6
  class AgentSetupInitTest < Minitest::Test
7
7
  CONFIG_FILENAME = '123.yml'
8
- SUBFOLDER_CONFIG_FILEPATH = 'conf/123.yml'
9
- EXPECTED_CONFIG_CONTENT = %(name: appmap-ruby
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
- assert_includes output, 'The AppMap config file appmap.yml already exists.'
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
- assert_includes output, "The following AppMap config file #{CONFIG_FILENAME} has been created:"
24
- assert_equal EXPECTED_CONFIG_CONTENT, File.read(CONFIG_FILENAME)
25
- ensure
26
- File.delete(CONFIG_FILENAME) if File.exist?(CONFIG_FILENAME)
27
- end
28
-
29
- def test_init_with_custom_config_file_in_subfolder
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.56.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-28 00:00:00.000000000 Z
11
+ date: 2021-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport