kpm 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +66 -0
  3. data/Gemfile +2 -0
  4. data/README.adoc +111 -109
  5. data/Rakefile +2 -1
  6. data/bin/kpm +4 -2
  7. data/kpm.gemspec +8 -6
  8. data/lib/kpm.rb +3 -0
  9. data/lib/kpm/account.rb +267 -338
  10. data/lib/kpm/base_artifact.rb +33 -39
  11. data/lib/kpm/base_installer.rb +69 -83
  12. data/lib/kpm/blob.rb +29 -0
  13. data/lib/kpm/cli.rb +3 -1
  14. data/lib/kpm/coordinates.rb +6 -9
  15. data/lib/kpm/database.rb +90 -114
  16. data/lib/kpm/diagnostic_file.rb +126 -147
  17. data/lib/kpm/formatter.rb +74 -46
  18. data/lib/kpm/inspector.rb +22 -32
  19. data/lib/kpm/installer.rb +53 -46
  20. data/lib/kpm/kaui_artifact.rb +4 -3
  21. data/lib/kpm/killbill_plugin_artifact.rb +10 -7
  22. data/lib/kpm/killbill_server_artifact.rb +13 -12
  23. data/lib/kpm/migrations.rb +8 -7
  24. data/lib/kpm/nexus_helper/actions.rb +47 -8
  25. data/lib/kpm/nexus_helper/nexus_api_calls_v2.rb +87 -94
  26. data/lib/kpm/nexus_helper/nexus_facade.rb +5 -3
  27. data/lib/kpm/plugins_directory.rb +9 -8
  28. data/lib/kpm/plugins_directory.yml +8 -175
  29. data/lib/kpm/plugins_manager.rb +29 -24
  30. data/lib/kpm/sha1_checker.rb +31 -18
  31. data/lib/kpm/system.rb +105 -136
  32. data/lib/kpm/system_helpers/cpu_information.rb +56 -55
  33. data/lib/kpm/system_helpers/disk_space_information.rb +60 -63
  34. data/lib/kpm/system_helpers/entropy_available.rb +37 -39
  35. data/lib/kpm/system_helpers/memory_information.rb +52 -51
  36. data/lib/kpm/system_helpers/os_information.rb +45 -47
  37. data/lib/kpm/system_helpers/system_proxy.rb +10 -10
  38. data/lib/kpm/tasks.rb +364 -437
  39. data/lib/kpm/tenant_config.rb +68 -83
  40. data/lib/kpm/tomcat_manager.rb +9 -8
  41. data/lib/kpm/trace_logger.rb +18 -16
  42. data/lib/kpm/uninstaller.rb +81 -14
  43. data/lib/kpm/utils.rb +13 -14
  44. data/lib/kpm/version.rb +3 -1
  45. data/packaging/Gemfile +2 -0
  46. data/pom.xml +1 -1
  47. data/spec/kpm/remote/base_artifact_spec.rb +13 -15
  48. data/spec/kpm/remote/base_installer_spec.rb +30 -29
  49. data/spec/kpm/remote/installer_spec.rb +73 -73
  50. data/spec/kpm/remote/kaui_artifact_spec.rb +7 -6
  51. data/spec/kpm/remote/killbill_plugin_artifact_spec.rb +19 -24
  52. data/spec/kpm/remote/killbill_server_artifact_spec.rb +17 -16
  53. data/spec/kpm/remote/migrations_spec.rb +12 -11
  54. data/spec/kpm/remote/nexus_facade_spec.rb +30 -26
  55. data/spec/kpm/remote/tenant_config_spec.rb +27 -26
  56. data/spec/kpm/remote/tomcat_manager_spec.rb +2 -1
  57. data/spec/kpm/unit/actions_spec.rb +52 -0
  58. data/spec/kpm/unit/base_artifact_spec.rb +17 -16
  59. data/spec/kpm/unit/cpu_information_spec.rb +67 -0
  60. data/spec/kpm/unit/disk_space_information_spec.rb +47 -0
  61. data/spec/kpm/unit/entropy_information_spec.rb +36 -0
  62. data/spec/kpm/unit/formatter_spec.rb +163 -0
  63. data/spec/kpm/unit/inspector_spec.rb +34 -42
  64. data/spec/kpm/unit/installer_spec.rb +5 -4
  65. data/spec/kpm/unit/memory_information_spec.rb +102 -0
  66. data/spec/kpm/unit/os_information_spec.rb +38 -0
  67. data/spec/kpm/unit/plugins_directory_spec.rb +34 -18
  68. data/spec/kpm/unit/plugins_manager_spec.rb +61 -65
  69. data/spec/kpm/unit/sha1_checker_spec.rb +107 -60
  70. data/spec/kpm/unit/uninstaller_spec.rb +107 -61
  71. data/spec/kpm/unit_mysql/account_spec.rb +120 -135
  72. data/spec/spec_helper.rb +19 -17
  73. data/tasks/package.rake +18 -18
  74. metadata +17 -8
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pathname'
2
4
  require 'rubygems/package'
3
5
  require 'zlib'
@@ -7,7 +9,7 @@ module KPM
7
9
  class << self
8
10
  TAR_LONGLINK = '././@LongLink'
9
11
 
10
- def unpack_tgz(tar_gz_archive, destination, skip_top_dir=false)
12
+ def unpack_tgz(tar_gz_archive, destination, skip_top_dir = false)
11
13
  top_dir = nil
12
14
  Gem::Package::TarReader.new(Zlib::GzipReader.open(tar_gz_archive)) do |tar|
13
15
  dest = nil
@@ -20,17 +22,17 @@ module KPM
20
22
 
21
23
  if entry.directory?
22
24
  File.delete dest if File.file? dest
23
- FileUtils.mkdir_p dest, :mode => entry.header.mode, :verbose => false
25
+ FileUtils.mkdir_p dest, mode: entry.header.mode, verbose: false
24
26
  elsif entry.file?
25
27
  FileUtils.rm_rf dest if File.directory? dest
26
- FileUtils.mkdir_p File.dirname(dest), :verbose => false
27
- File.open dest, "wb" do |f|
28
+ FileUtils.mkdir_p File.dirname(dest), verbose: false
29
+ File.open dest, 'wb' do |f|
28
30
  f.print entry.read
29
31
  end
30
- FileUtils.chmod entry.header.mode, dest, :verbose => false
32
+ FileUtils.chmod entry.header.mode, dest, verbose: false
31
33
  current_dir = File.dirname(dest)
32
34
  # In case there are two top dirs, keep the last one by convention
33
- top_dir = current_dir if (top_dir.nil? || top_dir.size >= current_dir.size)
35
+ top_dir = current_dir if top_dir.nil? || top_dir.size >= current_dir.size
34
36
  elsif entry.header.typeflag == '2' # Symlink
35
37
  File.symlink entry.header.linkname, dest
36
38
  end
@@ -48,9 +50,7 @@ module KPM
48
50
  file_names = []
49
51
  Gem::Package::TarReader.new(Zlib::GzipReader.open(tar_gz_archive)) do |tar|
50
52
  tar.each do |entry|
51
- if entry.file?
52
- file_names.push entry.full_name
53
- end
53
+ file_names.push entry.full_name if entry.file?
54
54
  end
55
55
  end
56
56
 
@@ -62,17 +62,17 @@ module KPM
62
62
  ver = get_version_from_file_path(file_path)
63
63
  ext = File.extname(base)
64
64
 
65
- name = base.gsub(ext,'')
65
+ name = base.gsub(ext, '')
66
66
  if ver.nil?
67
67
  # this will remove SNAPSHOT and any dash that appear before it (ex --SNAPSHOT).
68
- name = name.gsub(/((-+){,1}SNAPSHOT){,1}/,'')
68
+ name = name.gsub(/((-+){,1}SNAPSHOT){,1}/, '')
69
69
  last_dash = name.rindex('-')
70
70
  name = name[0..last_dash] unless last_dash.nil?
71
71
  else
72
- name = name.gsub(ver,'')
72
+ name = name.gsub(ver, '')
73
73
  end
74
74
 
75
- name = name[0..name.length-2] if name[-1].match(/[a-zA-z]/).nil?
75
+ name = name[0..name.length - 2] if name[-1].match(/[a-zA-z]/).nil?
76
76
  name
77
77
  end
78
78
 
@@ -84,7 +84,6 @@ module KPM
84
84
 
85
85
  ver[0]
86
86
  end
87
-
88
87
  end
89
88
  end
90
89
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module KPM
2
- VERSION = '0.7.2'
4
+ VERSION = '0.8.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gem 'kpm', '~> VERSION'
data/pom.xml CHANGED
@@ -26,7 +26,7 @@
26
26
  <groupId>org.kill-bill.billing.installer</groupId>
27
27
  <artifactId>kpm</artifactId>
28
28
  <packaging>pom</packaging>
29
- <version>0.7.2</version>
29
+ <version>0.8.0</version>
30
30
  <name>KPM</name>
31
31
  <url>http://github.com/killbill/killbill-cloud</url>
32
32
  <description>KPM: the Kill Bill Package Manager</description>
@@ -1,7 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe KPM::BaseArtifact do
4
-
5
6
  before(:all) do
6
7
  @logger = Logger.new(STDOUT)
7
8
  @logger.level = Logger::INFO
@@ -26,7 +27,7 @@ describe KPM::BaseArtifact do
26
27
  end
27
28
 
28
29
  it 'should be able to handle download errors' do
29
- nexus_down = {:url => 'https://does.not.exist'}
30
+ nexus_down = { url: 'https://does.not.exist' }
30
31
  Dir.mktmpdir do |dir|
31
32
  sha1_file = "#{dir}/sha1.yml"
32
33
  test_download dir, 'foo-oss.pom.xml', false, false, sha1_file
@@ -35,10 +36,10 @@ describe KPM::BaseArtifact do
35
36
  # Verify the download is skipped gracefully when Nexus isn't reachable
36
37
  test_download dir, 'foo-oss.pom.xml', true, false, sha1_file, nexus_down
37
38
  # Verify the download fails when Nexus isn't reachable and force_download is set
38
- expect { test_download dir, 'foo-oss.pom.xml', nil, true, sha1_file, nexus_down }.to raise_error(SocketError)
39
+ expect { test_download dir, 'foo-oss.pom.xml', nil, true, sha1_file, nexus_down }.to raise_error
39
40
  # Verify the download fails when Nexus isn't reachable and the Nexus cache is empty
40
- KPM::Sha1Checker.from_file(sha1_file).cache_artifact_info('org.kill-bill.billing:killbill-oss-parent:pom:LATEST', nil)
41
- expect { test_download dir, 'foo-oss.pom.xml', nil, false, sha1_file, nexus_down }.to raise_error(SocketError)
41
+ KPM::Sha1Checker.from_file(sha1_file).cache_artifact_info('org.kill-bill.billing:killbill-oss-parent:pom:0.143.33', nil)
42
+ expect { test_download dir, 'foo-oss.pom.xml', nil, false, sha1_file, nexus_down }.to raise_error
42
43
  end
43
44
  end
44
45
 
@@ -55,11 +56,11 @@ describe KPM::BaseArtifact do
55
56
  info[:file_name].should be_nil
56
57
 
57
58
  files_in_dir = Dir[info[:file_path] + '/*']
58
- files_in_dir.size.should == 20
59
+ files_in_dir.size.should eq 20
59
60
 
60
61
  File.file?(info[:file_path] + '/killbill-osgi-bundles-jruby-0.11.3.jar').should be_true
61
62
 
62
- info[:bundle_dir].should == info[:file_path]
63
+ info[:bundle_dir].should eq info[:file_path]
63
64
  end
64
65
  end
65
66
 
@@ -79,18 +80,15 @@ describe KPM::BaseArtifact do
79
80
  second_take = KPM::BaseArtifact.pull(@logger, group_id, artifact_id, packaging, classifier, second_bundle_version, dir)
80
81
  File.file?(first_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.2.jar').should be_false
81
82
  File.file?(second_take[:file_path] + '/killbill-platform-osgi-bundles-jruby-0.36.10.jar').should be_true
82
-
83
83
  end
84
84
  end
85
85
 
86
- def test_download(dir, filename=nil, verify_is_skipped=false, force_download=false, sha1_file=nil, overrides={})
86
+ def test_download(dir, filename = nil, verify_is_skipped = false, force_download = false, sha1_file = nil, overrides = {})
87
87
  path = filename.nil? ? dir : dir + '/' + filename
88
88
 
89
- info = KPM::BaseArtifact.pull(@logger, 'org.kill-bill.billing', 'killbill-oss-parent', 'pom', nil, 'LATEST', path, sha1_file, force_download, true, overrides, true)
90
- info[:file_name].should == (filename.nil? ? "killbill-oss-parent-#{info[:version]}.pom" : filename)
91
- info[:skipped].should == verify_is_skipped
92
- if !info[:skipped]
93
- info[:size].should == File.size(info[:file_path])
94
- end
89
+ info = KPM::BaseArtifact.pull(@logger, 'org.kill-bill.billing', 'killbill-oss-parent', 'pom', nil, '0.143.33', path, sha1_file, force_download, true, overrides, true)
90
+ info[:file_name].should eq(filename.nil? ? "killbill-oss-parent-#{info[:version]}.pom" : filename)
91
+ info[:skipped].should eq verify_is_skipped
92
+ info[:size].should eq File.size(info[:file_path]) unless info[:skipped]
95
93
  end
96
94
  end
@@ -1,8 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'json'
3
5
 
4
6
  describe KPM::BaseInstaller do
5
-
6
7
  before(:all) do
7
8
  @logger = Logger.new(STDOUT)
8
9
  @logger.level = Logger::INFO
@@ -13,7 +14,7 @@ describe KPM::BaseInstaller do
13
14
  bundles_dir = dir + '/bundles'
14
15
  installer = KPM::BaseInstaller.new(@logger)
15
16
 
16
- info = installer.install_plugin('analytics', nil, nil, nil, nil, nil, '0.7.1', bundles_dir)
17
+ installer.install_plugin('analytics', nil, nil, nil, nil, nil, '0.7.1', bundles_dir)
17
18
 
18
19
  check_installation(bundles_dir)
19
20
 
@@ -46,23 +47,23 @@ describe KPM::BaseInstaller do
46
47
 
47
48
  begin
48
49
  installer.install_plugin('invalid', nil, nil, nil, nil, nil, '1.2.3', bundles_dir)
49
- fail "Should not succeed to install invalid plugin"
50
- rescue ArgumentError => e
50
+ raise 'Should not succeed to install invalid plugin'
51
+ rescue ArgumentError
52
+ # Expected
51
53
  end
52
54
  end
53
55
  end
54
56
 
55
57
  it 'should extract plugin name from file path' do
56
-
57
58
  [
58
- {:file_path => '/Somewhere/xxx-foo/target/xxx-1.0.0.jar', :expected => 'xxx'},
59
- {:file_path => '/Somewhere/xxx-foo/target/xxx-foo-bar-1.0.0.jar', :expected => 'xxx-foo-bar'},
60
- {:file_path => '/Somewhere/xxx-foo/target/xxx-foo-1.0.0.jar', :expected => 'xxx-foo'},
61
- {:file_path => '/Somewhere/xxx-foo/target/xxx-foo-1.0.0-SNAPSHOT.jar', :expected => 'xxx-foo'},
62
- {:file_path => '/Somewhere/xxx-foo/target/xxx-foo-1.0.jar', :expected => 'xxx-foo'},
63
- {:file_path => '/Somewhere/xxx-foo/target/xxx-foo-1.jar', :expected => 'xxx-foo'},
64
- {:file_path => '/Somewhere/xxx-foo/target/xxx-foo-abc-SNAPSHOT.jar', :expected => 'xxx-foo'},
65
- {:file_path => '/Somewhere/xxx-foo/target/xxx-foo-abc.jar', :expected => 'xxx-foo'}
59
+ { file_path: '/Somewhere/xxx-foo/target/xxx-1.0.0.jar', expected: 'xxx' },
60
+ { file_path: '/Somewhere/xxx-foo/target/xxx-foo-bar-1.0.0.jar', expected: 'xxx-foo-bar' },
61
+ { file_path: '/Somewhere/xxx-foo/target/xxx-foo-1.0.0.jar', expected: 'xxx-foo' },
62
+ { file_path: '/Somewhere/xxx-foo/target/xxx-foo-1.0.0-SNAPSHOT.jar', expected: 'xxx-foo' },
63
+ { file_path: '/Somewhere/xxx-foo/target/xxx-foo-1.0.jar', expected: 'xxx-foo' },
64
+ { file_path: '/Somewhere/xxx-foo/target/xxx-foo-1.jar', expected: 'xxx-foo' },
65
+ { file_path: '/Somewhere/xxx-foo/target/xxx-foo-abc-SNAPSHOT.jar', expected: 'xxx-foo' },
66
+ { file_path: '/Somewhere/xxx-foo/target/xxx-foo-abc.jar', expected: 'xxx-foo' }
66
67
  ].each do |test|
67
68
  KPM::Utils.get_plugin_name_from_file_path(test[:file_path]).should eq test[:expected]
68
69
  end
@@ -75,14 +76,14 @@ describe KPM::BaseInstaller do
75
76
 
76
77
  plugin_identifiers = read_plugin_identifiers(plugins_dir)
77
78
 
78
- plugin_identifiers.size.should == 1
79
+ plugin_identifiers.size.should eq 1
79
80
 
80
- plugin_identifiers['analytics']['plugin_name'].should == 'analytics-plugin'
81
- plugin_identifiers['analytics']['group_id'].should == 'org.kill-bill.billing.plugin.java'
82
- plugin_identifiers['analytics']['artifact_id'].should == 'analytics-plugin'
83
- plugin_identifiers['analytics']['packaging'].should == 'jar'
84
- plugin_identifiers['analytics']['version'].should == '0.7.1'
85
- plugin_identifiers['analytics']['language'].should == 'java'
81
+ plugin_identifiers['analytics']['plugin_name'].should eq 'analytics-plugin'
82
+ plugin_identifiers['analytics']['group_id'].should eq 'org.kill-bill.billing.plugin.java'
83
+ plugin_identifiers['analytics']['artifact_id'].should eq 'analytics-plugin'
84
+ plugin_identifiers['analytics']['packaging'].should eq 'jar'
85
+ plugin_identifiers['analytics']['version'].should eq '0.7.1'
86
+ plugin_identifiers['analytics']['language'].should eq 'java'
86
87
 
87
88
  File.file?(plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp/disabled.txt').should be_false
88
89
  end
@@ -92,26 +93,26 @@ describe KPM::BaseInstaller do
92
93
 
93
94
  plugin_identifiers = read_plugin_identifiers(plugins_dir)
94
95
 
95
- plugin_identifiers.size.should == 0
96
+ plugin_identifiers.size.should eq 0
96
97
 
97
98
  File.file?(plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp/disabled.txt').should be_true
98
99
  end
99
100
 
100
101
  def common_checks(plugins_dir)
101
102
  [
102
- plugins_dir,
103
- plugins_dir + '/plugins',
104
- plugins_dir + '/plugins/java',
105
- plugins_dir + '/plugins/java/analytics-plugin',
106
- plugins_dir + '/plugins/java/analytics-plugin/0.7.1',
107
- plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp',
103
+ plugins_dir,
104
+ plugins_dir + '/plugins',
105
+ plugins_dir + '/plugins/java',
106
+ plugins_dir + '/plugins/java/analytics-plugin',
107
+ plugins_dir + '/plugins/java/analytics-plugin/0.7.1',
108
+ plugins_dir + '/plugins/java/analytics-plugin/0.7.1/tmp'
108
109
  ].each do |dir|
109
110
  File.directory?(dir).should be_true
110
111
  end
111
112
 
112
113
  [
113
- plugins_dir + '/plugins/plugin_identifiers.json',
114
- plugins_dir + '/plugins/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar'
114
+ plugins_dir + '/plugins/plugin_identifiers.json',
115
+ plugins_dir + '/plugins/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar'
115
116
  ].each do |file|
116
117
  File.file?(file).should be_true
117
118
  end
@@ -1,8 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'json'
3
5
 
4
6
  describe KPM::Installer do
5
-
6
7
  before(:all) do
7
8
  @logger = Logger.new(STDOUT)
8
9
  @logger.level = Logger::INFO
@@ -12,15 +13,15 @@ describe KPM::Installer do
12
13
  Dir.mktmpdir do |dir|
13
14
  kb_webapp_path = dir + '/KB_ROOT.war'
14
15
  installer = KPM::Installer.new({
15
- 'killbill' => {
16
- 'webapp_path' => kb_webapp_path
17
- }
16
+ 'killbill' => {
17
+ 'webapp_path' => kb_webapp_path
18
+ }
18
19
  },
19
20
  @logger)
20
21
 
21
22
  # No exception
22
23
  response = nil
23
- expect{ response = installer.install }.to_not raise_exception
24
+ expect { response = installer.install }.to_not raise_exception
24
25
  response = JSON[response]
25
26
  response['help'].should be_nil
26
27
  response['killbill']['status'].should eq 'INSTALLED'
@@ -31,15 +32,15 @@ describe KPM::Installer do
31
32
  Dir.mktmpdir do |dir|
32
33
  kaui_webapp_path = dir + '/KAUI_ROOT.war'
33
34
  installer = KPM::Installer.new({
34
- 'kaui' => {
35
- 'webapp_path' => kaui_webapp_path
36
- }
35
+ 'kaui' => {
36
+ 'webapp_path' => kaui_webapp_path
37
+ }
37
38
  },
38
39
  @logger)
39
40
 
40
41
  # No exception
41
42
  response = nil
42
- expect{ response = installer.install }.to_not raise_exception
43
+ expect { response = installer.install }.to_not raise_exception
43
44
  response = JSON[response]
44
45
  response['help'].should be_nil
45
46
  response['kaui']['status'].should eq 'INSTALLED'
@@ -52,29 +53,29 @@ describe KPM::Installer do
52
53
  kaui_webapp_path = dir + '/KAUI_ROOT.war'
53
54
  plugins_dir = dir + '/bundles'
54
55
  installer = KPM::Installer.new({
55
- 'killbill' => {
56
- 'webapp_path' => kb_webapp_path,
57
- 'plugins_dir' => plugins_dir,
58
- 'plugins' => {
59
- 'java' => [{
60
- 'name' => 'analytics',
61
- 'version' => '0.7.1'
62
- }],
63
- 'ruby' => [{
64
- 'name' => 'payment-test-plugin',
65
- 'artifact_id' => 'payment-test-plugin',
66
- 'group_id' => 'org.kill-bill.billing.plugin.ruby',
67
- 'version' => '1.8.7'
68
- },
69
- {
70
- 'name' => 'stripe',
71
- 'version' => '3.0.3'
72
- }]
73
- }
74
- },
75
- 'kaui' => {
76
- 'webapp_path' => kaui_webapp_path
56
+ 'killbill' => {
57
+ 'webapp_path' => kb_webapp_path,
58
+ 'plugins_dir' => plugins_dir,
59
+ 'plugins' => {
60
+ 'java' => [{
61
+ 'name' => 'analytics',
62
+ 'version' => '0.7.1'
63
+ }],
64
+ 'ruby' => [{
65
+ 'name' => 'payment-test-plugin',
66
+ 'artifact_id' => 'payment-test-plugin',
67
+ 'group_id' => 'org.kill-bill.billing.plugin.ruby',
68
+ 'version' => '1.8.7'
69
+ },
70
+ {
71
+ 'name' => 'stripe',
72
+ 'version' => '3.0.3'
73
+ }]
77
74
  }
75
+ },
76
+ 'kaui' => {
77
+ 'webapp_path' => kaui_webapp_path
78
+ }
78
79
  },
79
80
  @logger)
80
81
 
@@ -87,11 +88,10 @@ describe KPM::Installer do
87
88
 
88
89
  # Finally verify that for both (well behaved) ruby and java plugin, skipping the install will still correctly return the `:bundle_dir`
89
90
  info = installer.install_plugin('payment-test-plugin', nil, 'org.kill-bill.billing.plugin.ruby', 'payment-test-plugin', nil, nil, '1.8.7', plugins_dir)
90
- info[:bundle_dir].should == plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7'
91
-
91
+ info[:bundle_dir].should eq plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7'
92
92
 
93
- info = installer.install_plugin('analytics', nil, nil, nil, nil, nil, '0.7.1', plugins_dir)
94
- info[:bundle_dir].should == plugins_dir + '/plugins/java/analytics-plugin/0.7.1'
93
+ info = installer.install_plugin('analytics', nil, nil, nil, nil, nil, '0.7.1', plugins_dir)
94
+ info[:bundle_dir].should eq plugins_dir + '/plugins/java/analytics-plugin/0.7.1'
95
95
  end
96
96
  end
97
97
 
@@ -99,27 +99,27 @@ describe KPM::Installer do
99
99
 
100
100
  def check_installation(plugins_dir, kb_webapp_path, kaui_webapp_path)
101
101
  [
102
- plugins_dir,
103
- plugins_dir + '/platform',
104
- plugins_dir + '/plugins',
105
- plugins_dir + '/plugins/java',
106
- plugins_dir + '/plugins/java/analytics-plugin',
107
- plugins_dir + '/plugins/java/analytics-plugin/0.7.1',
108
- plugins_dir + '/plugins/ruby',
109
- plugins_dir + '/plugins/ruby/killbill-payment-test',
110
- plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7',
111
- plugins_dir + '/plugins/ruby/killbill-stripe'
102
+ plugins_dir,
103
+ plugins_dir + '/platform',
104
+ plugins_dir + '/plugins',
105
+ plugins_dir + '/plugins/java',
106
+ plugins_dir + '/plugins/java/analytics-plugin',
107
+ plugins_dir + '/plugins/java/analytics-plugin/0.7.1',
108
+ plugins_dir + '/plugins/ruby',
109
+ plugins_dir + '/plugins/ruby/killbill-payment-test',
110
+ plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7',
111
+ plugins_dir + '/plugins/ruby/killbill-stripe'
112
112
  ].each do |dir|
113
113
  File.directory?(dir).should be_true
114
114
  end
115
115
 
116
116
  [
117
- kb_webapp_path,
118
- kaui_webapp_path,
119
- plugins_dir + '/platform/jruby.jar',
120
- plugins_dir + '/plugins/plugin_identifiers.json',
121
- plugins_dir + '/plugins/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar',
122
- plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7/killbill.properties'
117
+ kb_webapp_path,
118
+ kaui_webapp_path,
119
+ plugins_dir + '/platform/jruby.jar',
120
+ plugins_dir + '/plugins/plugin_identifiers.json',
121
+ plugins_dir + '/plugins/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar',
122
+ plugins_dir + '/plugins/ruby/killbill-payment-test/1.8.7/killbill.properties'
123
123
  ].each do |file|
124
124
  File.file?(file).should be_true
125
125
  end
@@ -128,27 +128,27 @@ describe KPM::Installer do
128
128
  JSON.parse(f.read)
129
129
  end
130
130
 
131
- plugin_identifiers.size.should == 3
132
-
133
- plugin_identifiers['analytics']['plugin_name'].should == 'analytics-plugin'
134
- plugin_identifiers['analytics']['group_id'].should == 'org.kill-bill.billing.plugin.java'
135
- plugin_identifiers['analytics']['artifact_id'].should == 'analytics-plugin'
136
- plugin_identifiers['analytics']['packaging'].should == 'jar'
137
- plugin_identifiers['analytics']['version'].should == '0.7.1'
138
- plugin_identifiers['analytics']['language'].should == 'java'
139
-
140
- plugin_identifiers['payment-test-plugin']['plugin_name'].should == 'killbill-payment-test'
141
- plugin_identifiers['payment-test-plugin']['group_id'].should == 'org.kill-bill.billing.plugin.ruby'
142
- plugin_identifiers['payment-test-plugin']['artifact_id'].should == 'payment-test-plugin'
143
- plugin_identifiers['payment-test-plugin']['packaging'].should == 'tar.gz'
144
- plugin_identifiers['payment-test-plugin']['version'].should == '1.8.7'
145
- plugin_identifiers['payment-test-plugin']['language'].should == 'ruby'
146
-
147
- plugin_identifiers['stripe']['plugin_name'].should == 'killbill-stripe'
148
- plugin_identifiers['stripe']['group_id'].should == 'org.kill-bill.billing.plugin.ruby'
149
- plugin_identifiers['stripe']['artifact_id'].should == 'stripe-plugin'
150
- plugin_identifiers['stripe']['packaging'].should == 'tar.gz'
151
- plugin_identifiers['stripe']['version'].should == '3.0.3'
152
- plugin_identifiers['stripe']['language'].should == 'ruby'
131
+ plugin_identifiers.size.should eq 3
132
+
133
+ plugin_identifiers['analytics']['plugin_name'].should eq 'analytics-plugin'
134
+ plugin_identifiers['analytics']['group_id'].should eq 'org.kill-bill.billing.plugin.java'
135
+ plugin_identifiers['analytics']['artifact_id'].should eq 'analytics-plugin'
136
+ plugin_identifiers['analytics']['packaging'].should eq 'jar'
137
+ plugin_identifiers['analytics']['version'].should eq '0.7.1'
138
+ plugin_identifiers['analytics']['language'].should eq 'java'
139
+
140
+ plugin_identifiers['payment-test-plugin']['plugin_name'].should eq 'killbill-payment-test'
141
+ plugin_identifiers['payment-test-plugin']['group_id'].should eq 'org.kill-bill.billing.plugin.ruby'
142
+ plugin_identifiers['payment-test-plugin']['artifact_id'].should eq 'payment-test-plugin'
143
+ plugin_identifiers['payment-test-plugin']['packaging'].should eq 'tar.gz'
144
+ plugin_identifiers['payment-test-plugin']['version'].should eq '1.8.7'
145
+ plugin_identifiers['payment-test-plugin']['language'].should eq 'ruby'
146
+
147
+ plugin_identifiers['stripe']['plugin_name'].should eq 'killbill-stripe'
148
+ plugin_identifiers['stripe']['group_id'].should eq 'org.kill-bill.billing.plugin.ruby'
149
+ plugin_identifiers['stripe']['artifact_id'].should eq 'stripe-plugin'
150
+ plugin_identifiers['stripe']['packaging'].should eq 'tar.gz'
151
+ plugin_identifiers['stripe']['version'].should eq '3.0.3'
152
+ plugin_identifiers['stripe']['language'].should eq 'ruby'
153
153
  end
154
154
  end