omnibus 5.4.0 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -3
  3. data/CHANGELOG.md +21 -0
  4. data/Gemfile +8 -5
  5. data/README.md +3 -1
  6. data/Rakefile +20 -13
  7. data/appveyor.yml +4 -3
  8. data/bin/omnibus +3 -3
  9. data/features/commands/manifest.feature +19 -5
  10. data/features/step_definitions/generator_steps.rb +5 -6
  11. data/features/support/env.rb +4 -4
  12. data/lib/omnibus/build_version.rb +14 -14
  13. data/lib/omnibus/build_version_dsl.rb +3 -3
  14. data/lib/omnibus/builder.rb +50 -61
  15. data/lib/omnibus/changelog.rb +2 -2
  16. data/lib/omnibus/changelog_printer.rb +4 -4
  17. data/lib/omnibus/cleaner.rb +4 -4
  18. data/lib/omnibus/cli/base.rb +15 -15
  19. data/lib/omnibus/cli/cache.rb +13 -13
  20. data/lib/omnibus/cli/changelog.rb +8 -9
  21. data/lib/omnibus/cli/publish.rb +12 -13
  22. data/lib/omnibus/cli.rb +26 -27
  23. data/lib/omnibus/compressor.rb +6 -6
  24. data/lib/omnibus/compressors/base.rb +7 -2
  25. data/lib/omnibus/compressors/dmg.rb +12 -12
  26. data/lib/omnibus/compressors/null.rb +1 -1
  27. data/lib/omnibus/compressors/tgz.rb +8 -8
  28. data/lib/omnibus/config.rb +37 -26
  29. data/lib/omnibus/core_extensions/open_uri.rb +3 -3
  30. data/lib/omnibus/core_extensions.rb +1 -1
  31. data/lib/omnibus/digestable.rb +5 -4
  32. data/lib/omnibus/download_helpers.rb +7 -6
  33. data/lib/omnibus/exceptions.rb +29 -13
  34. data/lib/omnibus/fetcher.rb +0 -1
  35. data/lib/omnibus/fetchers/git_fetcher.rb +7 -7
  36. data/lib/omnibus/fetchers/net_fetcher.rb +19 -19
  37. data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
  38. data/lib/omnibus/file_syncer.rb +3 -3
  39. data/lib/omnibus/generator.rb +60 -47
  40. data/lib/omnibus/git_cache.rb +33 -22
  41. data/lib/omnibus/git_repository.rb +5 -5
  42. data/lib/omnibus/health_check.rb +122 -119
  43. data/lib/omnibus/instrumentation.rb +1 -1
  44. data/lib/omnibus/licensing.rb +348 -60
  45. data/lib/omnibus/logger.rb +12 -9
  46. data/lib/omnibus/logging.rb +1 -1
  47. data/lib/omnibus/manifest.rb +4 -4
  48. data/lib/omnibus/manifest_diff.rb +6 -7
  49. data/lib/omnibus/manifest_entry.rb +1 -1
  50. data/lib/omnibus/metadata.rb +36 -36
  51. data/lib/omnibus/ohai.rb +6 -7
  52. data/lib/omnibus/package.rb +1 -1
  53. data/lib/omnibus/packager.rb +37 -28
  54. data/lib/omnibus/packagers/appx.rb +86 -0
  55. data/lib/omnibus/packagers/base.rb +21 -18
  56. data/lib/omnibus/packagers/bff.rb +22 -24
  57. data/lib/omnibus/packagers/deb.rb +20 -20
  58. data/lib/omnibus/packagers/ips.rb +18 -17
  59. data/lib/omnibus/packagers/makeself.rb +7 -7
  60. data/lib/omnibus/packagers/msi.rb +38 -193
  61. data/lib/omnibus/packagers/pkg.rb +16 -16
  62. data/lib/omnibus/packagers/rpm.rb +53 -54
  63. data/lib/omnibus/packagers/solaris.rb +14 -14
  64. data/lib/omnibus/packagers/windows_base.rb +192 -0
  65. data/lib/omnibus/project.rb +45 -43
  66. data/lib/omnibus/publisher.rb +3 -3
  67. data/lib/omnibus/publishers/artifactory_publisher.rb +39 -39
  68. data/lib/omnibus/publishers/s3_publisher.rb +7 -7
  69. data/lib/omnibus/reports.rb +10 -10
  70. data/lib/omnibus/s3_cache.rb +7 -7
  71. data/lib/omnibus/s3_helpers.rb +8 -7
  72. data/lib/omnibus/semantic_version.rb +1 -1
  73. data/lib/omnibus/software.rb +131 -81
  74. data/lib/omnibus/sugarable.rb +10 -10
  75. data/lib/omnibus/templating.rb +5 -5
  76. data/lib/omnibus/thread_pool.rb +1 -1
  77. data/lib/omnibus/util.rb +5 -5
  78. data/lib/omnibus/version.rb +1 -1
  79. data/lib/omnibus.rb +65 -65
  80. data/omnibus.gemspec +34 -32
  81. data/resources/appx/AppxManifest.xml.erb +18 -0
  82. data/resources/appx/assets/clear.png +0 -0
  83. data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-bundler-audit-0.5.0-COPYING.txt +674 -0
  84. data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-inifile-3.0.0-README.md +215 -0
  85. data/spec/fixtures/licensing/license_scout/snoopy/snoopy-dependency-licenses.json +24 -0
  86. data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-inifile-3.0.0-README.md +215 -0
  87. data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mime-types-3.1-Licence.rdoc +25 -0
  88. data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mini_portile2-2.1.0-LICENSE.txt +20 -0
  89. data/spec/fixtures/licensing/license_scout/zlib/zlib-dependency-licenses.json +32 -0
  90. data/spec/functional/builder_spec.rb +149 -150
  91. data/spec/functional/fetchers/git_fetcher_spec.rb +69 -71
  92. data/spec/functional/fetchers/net_fetcher_spec.rb +79 -79
  93. data/spec/functional/fetchers/path_fetcher_spec.rb +19 -20
  94. data/spec/functional/file_syncer_spec.rb +74 -74
  95. data/spec/functional/licensing_spec.rb +344 -35
  96. data/spec/functional/templating_spec.rb +17 -17
  97. data/spec/spec_helper.rb +20 -20
  98. data/spec/support/examples.rb +21 -15
  99. data/spec/support/file_helpers.rb +1 -1
  100. data/spec/support/git_helpers.rb +37 -37
  101. data/spec/support/matchers.rb +3 -3
  102. data/spec/support/ohai_helpers.rb +4 -4
  103. data/spec/support/path_helpers.rb +2 -2
  104. data/spec/support/shell_helpers.rb +2 -2
  105. data/spec/unit/build_version_dsl_spec.rb +5 -5
  106. data/spec/unit/build_version_spec.rb +63 -63
  107. data/spec/unit/builder_spec.rb +86 -70
  108. data/spec/unit/changelog_spec.rb +4 -4
  109. data/spec/unit/changelogprinter_spec.rb +130 -0
  110. data/spec/unit/cleanroom_spec.rb +11 -11
  111. data/spec/unit/compressor_spec.rb +16 -16
  112. data/spec/unit/compressors/base_spec.rb +6 -6
  113. data/spec/unit/compressors/dmg_spec.rb +76 -76
  114. data/spec/unit/compressors/null_spec.rb +4 -4
  115. data/spec/unit/compressors/tgz_spec.rb +20 -20
  116. data/spec/unit/config_spec.rb +44 -43
  117. data/spec/unit/digestable_spec.rb +13 -13
  118. data/spec/unit/fetcher_spec.rb +11 -12
  119. data/spec/unit/fetchers/git_fetcher_spec.rb +31 -31
  120. data/spec/unit/fetchers/net_fetcher_spec.rb +172 -173
  121. data/spec/unit/fetchers/path_fetcher_spec.rb +18 -18
  122. data/spec/unit/generator_spec.rb +38 -38
  123. data/spec/unit/git_cache_spec.rb +56 -54
  124. data/spec/unit/git_repository_spec.rb +2 -2
  125. data/spec/unit/health_check_spec.rb +40 -40
  126. data/spec/unit/library_spec.rb +35 -35
  127. data/spec/unit/manifest_diff_spec.rb +10 -11
  128. data/spec/unit/manifest_spec.rb +17 -17
  129. data/spec/unit/metadata_spec.rb +152 -152
  130. data/spec/unit/ohai_spec.rb +5 -5
  131. data/spec/unit/omnibus_spec.rb +31 -31
  132. data/spec/unit/package_spec.rb +20 -20
  133. data/spec/unit/packager_spec.rb +48 -42
  134. data/spec/unit/packagers/appx_spec.rb +165 -0
  135. data/spec/unit/packagers/base_spec.rb +34 -34
  136. data/spec/unit/packagers/bff_spec.rb +60 -60
  137. data/spec/unit/packagers/deb_spec.rb +71 -71
  138. data/spec/unit/packagers/ips_spec.rb +45 -45
  139. data/spec/unit/packagers/makeself_spec.rb +22 -22
  140. data/spec/unit/packagers/msi_spec.rb +141 -147
  141. data/spec/unit/packagers/pkg_spec.rb +59 -60
  142. data/spec/unit/packagers/rpm_spec.rb +125 -126
  143. data/spec/unit/packagers/solaris_spec.rb +52 -52
  144. data/spec/unit/project_spec.rb +137 -135
  145. data/spec/unit/publisher_spec.rb +70 -70
  146. data/spec/unit/publishers/artifactory_publisher_spec.rb +85 -85
  147. data/spec/unit/publishers/s3_publisher_spec.rb +36 -36
  148. data/spec/unit/s3_cacher_spec.rb +34 -34
  149. data/spec/unit/s3_helpers_spec.rb +6 -6
  150. data/spec/unit/semantic_version_spec.rb +2 -2
  151. data/spec/unit/software_spec.rb +346 -384
  152. data/spec/unit/sugarable_spec.rb +10 -10
  153. data/spec/unit/util_spec.rb +60 -60
  154. metadata +54 -6
  155. data/.rubocop.yml +0 -48
@@ -1,4 +1,4 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  module Omnibus
4
4
  describe Library do
@@ -19,49 +19,49 @@ module Omnibus
19
19
 
20
20
  let(:project) do
21
21
  Project.new.evaluate do
22
- name 'chef-dk'
23
- maintainer 'Chef Software, Inc'
24
- homepage 'http://getchef.com'
25
- build_version '1.0.0'
22
+ name "chef-dk"
23
+ maintainer "Chef Software, Inc"
24
+ homepage "http://getchef.com"
25
+ build_version "1.0.0"
26
26
 
27
- install_dir '/opt/chefdk'
27
+ install_dir "/opt/chefdk"
28
28
 
29
- dependency 'preparation'
30
- dependency 'erchef'
31
- dependency 'postgresql'
32
- dependency 'ruby'
33
- dependency 'chef'
34
- dependency 'chefdk'
29
+ dependency "preparation"
30
+ dependency "erchef"
31
+ dependency "postgresql"
32
+ dependency "ruby"
33
+ dependency "chef"
34
+ dependency "chefdk"
35
35
  end
36
36
  end
37
37
 
38
38
  let(:library) { Library.new(project) }
39
39
 
40
- let(:bundler) { generate_software('bundler', '1.5.4') }
41
- let(:curl) { generate_software('curl', '1.5.4', %w(openssl zlib)) }
42
- let(:chef) { generate_software('chef', '1.0.0', %w(bundler ohai ruby)) }
43
- let(:erchef) { generate_software('erchef', '4b19a96d57bff9bbf4764d7323b92a0944009b9e', %w(curl erlang rsync)) }
44
- let(:erlang) { generate_software('erlang', 'R15B03-1', %w(openssl zlib)) }
45
- let(:libgcc) { generate_software('libgcc', '0.0.0') }
46
- let(:ncurses) { generate_software('ncurses', '5.9', %w(libgcc)) }
47
- let(:ohai) { generate_software('ohai', 'master', %w(ruby rubygems yajl)) }
48
- let(:openssl) { generate_software('openssl', '1.0.1g', %w(zlib)) }
49
- let(:postgresql) { generate_software('postgresql', '9.2.8', %w(zlib openssl)) }
50
- let(:preparation) { generate_software('preparation', '1.0.0') }
51
- let(:rsync) { generate_software('rsync', '3.0.9') }
52
- let(:ruby) { generate_software('ruby', '1.9.3-p481', %w(zlib ncurses)) }
53
- let(:rubygems) { generate_software('rubygems', '1.8.24', %w(ruby)) }
54
- let(:skitch) { generate_software('skitch', '4.4.1', %w(postgresql)) }
55
- let(:yajl) { generate_software('yajl', '1.1.0', %w(rubygems)) }
56
- let(:zlib) { generate_software('zlib', '1.2.6', %w(libgcc)) }
40
+ let(:bundler) { generate_software("bundler", "1.5.4") }
41
+ let(:curl) { generate_software("curl", "1.5.4", %w{openssl zlib}) }
42
+ let(:chef) { generate_software("chef", "1.0.0", %w{bundler ohai ruby}) }
43
+ let(:erchef) { generate_software("erchef", "4b19a96d57bff9bbf4764d7323b92a0944009b9e", %w{curl erlang rsync}) }
44
+ let(:erlang) { generate_software("erlang", "R15B03-1", %w{openssl zlib}) }
45
+ let(:libgcc) { generate_software("libgcc", "0.0.0") }
46
+ let(:ncurses) { generate_software("ncurses", "5.9", %w{libgcc}) }
47
+ let(:ohai) { generate_software("ohai", "master", %w{ruby rubygems yajl}) }
48
+ let(:openssl) { generate_software("openssl", "1.0.1g", %w{zlib}) }
49
+ let(:postgresql) { generate_software("postgresql", "9.2.8", %w{zlib openssl}) }
50
+ let(:preparation) { generate_software("preparation", "1.0.0") }
51
+ let(:rsync) { generate_software("rsync", "3.0.9") }
52
+ let(:ruby) { generate_software("ruby", "1.9.3-p481", %w{zlib ncurses}) }
53
+ let(:rubygems) { generate_software("rubygems", "1.8.24", %w{ruby}) }
54
+ let(:skitch) { generate_software("skitch", "4.4.1", %w{postgresql}) }
55
+ let(:yajl) { generate_software("yajl", "1.1.0", %w{rubygems}) }
56
+ let(:zlib) { generate_software("zlib", "1.2.6", %w{libgcc}) }
57
57
 
58
58
  describe '#component_added' do
59
- it 'adds the software to the component list' do
59
+ it "adds the software to the component list" do
60
60
  library.component_added(erchef)
61
61
  expect(library.components).to eql([erchef])
62
62
  end
63
63
 
64
- it 'does not add a component more than once' do
64
+ it "does not add a component more than once" do
65
65
  library.component_added(erchef)
66
66
  library.component_added(erchef)
67
67
  expect(library.components).to eql([erchef])
@@ -81,7 +81,7 @@ module Omnibus
81
81
  library
82
82
  end
83
83
 
84
- it 'returns an array of software descriptions, with all top level deps first' do
84
+ it "returns an array of software descriptions, with all top level deps first" do
85
85
  expect(library.build_order).to eq([
86
86
  preparation,
87
87
  erlang,
@@ -93,8 +93,8 @@ module Omnibus
93
93
  ])
94
94
  end
95
95
 
96
- context 'with a complex dep tree' do
97
- let(:chefdk) { generate_software('chefdk', '1.0.0.alpha', %w(bundler ruby)) }
96
+ context "with a complex dep tree" do
97
+ let(:chefdk) { generate_software("chefdk", "1.0.0.alpha", %w{bundler ruby}) }
98
98
 
99
99
  let(:library) do
100
100
  # This is the LOAD ORDER
@@ -112,7 +112,7 @@ module Omnibus
112
112
  library
113
113
  end
114
114
 
115
- it 'returns an array of software descriptions, with all top level deps first, assuming they are not themselves transitive deps' do
115
+ it "returns an array of software descriptions, with all top level deps first, assuming they are not themselves transitive deps" do
116
116
  expect(library.build_order).to eql(
117
117
  [
118
118
  preparation, # first
@@ -1,17 +1,16 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  module Omnibus
4
4
  describe ManifestDiff do
5
5
  def manifest_entry_for(name, dv, lv)
6
- Omnibus::ManifestEntry.new(name, {:described_version => dv,
7
- :locked_version => lv,
8
- :locked_source => {
9
- :git => "git://#{name}@example.com"},
10
- :source_type => :git
6
+ Omnibus::ManifestEntry.new(name, { :described_version => dv,
7
+ :locked_version => lv,
8
+ :locked_source => {
9
+ :git => "git://#{name}@example.com" },
10
+ :source_type => :git,
11
11
  })
12
12
  end
13
13
 
14
-
15
14
  let(:manifest_one) do
16
15
  m = Omnibus::Manifest.new()
17
16
  m.add("foo", manifest_entry_for("foo", "1.2.4", "deadbeef"))
@@ -28,7 +27,7 @@ module Omnibus
28
27
  m
29
28
  end
30
29
 
31
- subject { described_class.new(manifest_one, manifest_two)}
30
+ subject { described_class.new(manifest_one, manifest_two) }
32
31
 
33
32
  describe "#updated" do
34
33
  it "returns items that existed in the first manifest but have been changed" do
@@ -36,7 +35,7 @@ module Omnibus
36
35
  :old_version => "deadbeef",
37
36
  :new_version => "deadbea0",
38
37
  :source_type => :git,
39
- :source => {:git => "git://foo@example.com"}
38
+ :source => { :git => "git://foo@example.com" },
40
39
  }])
41
40
  end
42
41
 
@@ -45,7 +44,7 @@ module Omnibus
45
44
  expect(subject.removed).to eq([{ :name => "bar",
46
45
  :old_version => "deadbeef",
47
46
  :source_type => :git,
48
- :source => {:git => "git://bar@example.com"}
47
+ :source => { :git => "git://bar@example.com" },
49
48
  }])
50
49
  end
51
50
  end
@@ -55,7 +54,7 @@ module Omnibus
55
54
  expect(subject.added).to eq([{ :name => "quux",
56
55
  :new_version => "deadbeef",
57
56
  :source_type => :git,
58
- :source => {:git => "git://quux@example.com"}
57
+ :source => { :git => "git://quux@example.com" },
59
58
  }])
60
59
  end
61
60
  end
@@ -1,6 +1,6 @@
1
- require 'spec_helper'
2
- require 'omnibus/manifest'
3
- require 'omnibus/manifest_entry'
1
+ require "spec_helper"
2
+ require "omnibus/manifest"
3
+ require "omnibus/manifest_entry"
4
4
 
5
5
  module Omnibus
6
6
  describe Manifest do
@@ -9,11 +9,11 @@ module Omnibus
9
9
  describe "#add" do
10
10
  it "stores manifest entries" do
11
11
  me = ManifestEntry.new("womabt", {})
12
- expect {subject.add("wombat", me)}.to_not raise_error
12
+ expect { subject.add("wombat", me) }.to_not raise_error
13
13
  end
14
14
 
15
15
  it "raises an error if it isn't given a ManifestEntry" do
16
- expect {subject.add("foobar", {})}.to raise_error Manifest::NotAManifestEntry
16
+ expect { subject.add("foobar", {}) }.to raise_error Manifest::NotAManifestEntry
17
17
  end
18
18
  end
19
19
 
@@ -25,7 +25,7 @@ module Omnibus
25
25
  end
26
26
 
27
27
  it "raises an error if no such manifest entry exists" do
28
- expect {subject.entry_for("non-existant-entry")}.to raise_error Manifest::MissingManifestEntry
28
+ expect { subject.entry_for("non-existant-entry") }.to raise_error Manifest::MissingManifestEntry
29
29
  end
30
30
  end
31
31
 
@@ -35,7 +35,7 @@ module Omnibus
35
35
  second = ManifestEntry.new("wombat", {})
36
36
  subject.add("foobar", first)
37
37
  subject.add("wombat", second)
38
- expect{ |b| subject.each &b }.to yield_successive_args(first, second)
38
+ expect { |b| subject.each(&b) }.to yield_successive_args(first, second)
39
39
  end
40
40
  end
41
41
 
@@ -90,17 +90,17 @@ module Omnibus
90
90
  locked_version: "new.newer",
91
91
  source_type: "url",
92
92
  described_version: "new.newer",
93
- }
94
- }
93
+ },
94
+ },
95
95
  }
96
96
  }
97
97
 
98
98
  it "has a build_version" do
99
- expect(Manifest.from_hash(manifest).build_version).to eq('12.4.0+20150629082811')
99
+ expect(Manifest.from_hash(manifest).build_version).to eq("12.4.0+20150629082811")
100
100
  end
101
101
 
102
102
  it "has a build_git_revision" do
103
- expect(Manifest.from_hash(manifest).build_git_revision).to eq('2e763ac957b308ba95cef256c2491a5a55a163cc')
103
+ expect(Manifest.from_hash(manifest).build_git_revision).to eq("2e763ac957b308ba95cef256c2491a5a55a163cc")
104
104
  end
105
105
 
106
106
  it "returns a manifest from a hash" do
@@ -108,7 +108,7 @@ module Omnibus
108
108
  end
109
109
 
110
110
  it "normalizes the source to use symbols" do
111
- expect(Manifest.from_hash(manifest).entry_for(:zlib).locked_source).to eq({url: "an_url"})
111
+ expect(Manifest.from_hash(manifest).entry_for(:zlib).locked_source).to eq({ url: "an_url" })
112
112
  end
113
113
 
114
114
  context "v2 manifest" do
@@ -120,19 +120,19 @@ module Omnibus
120
120
  software: {
121
121
  zlib: {
122
122
  locked_source: {
123
- url: "an_url"
123
+ url: "an_url",
124
124
  },
125
125
  locked_version: "new.newer",
126
126
  source_type: "url",
127
127
  described_version: "new.newer",
128
128
  license: "Zlib",
129
- }
130
- }
129
+ },
130
+ },
131
131
  }
132
132
  }
133
133
 
134
134
  it "has a license" do
135
- expect(Manifest.from_hash(manifest).license).to eq('Unspecified')
135
+ expect(Manifest.from_hash(manifest).license).to eq("Unspecified")
136
136
  end
137
137
  end
138
138
 
@@ -144,7 +144,7 @@ module Omnibus
144
144
  }
145
145
 
146
146
  it "raises an error if it doesn't recognize the manifest version" do
147
- expect{Manifest.from_hash(manifest)}.to raise_error Manifest::InvalidManifestFormat
147
+ expect { Manifest.from_hash(manifest) }.to raise_error Manifest::InvalidManifestFormat
148
148
  end
149
149
  end
150
150
  end