omnibus 5.5.0 → 5.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +11 -0
  3. data/.travis.yml +2 -1
  4. data/CHANGELOG.md +37 -0
  5. data/Gemfile +5 -4
  6. data/MAINTAINERS.md +12 -17
  7. data/README.md +98 -107
  8. data/appveyor.yml +1 -1
  9. data/lib/omnibus.rb +4 -4
  10. data/lib/omnibus/builder.rb +42 -9
  11. data/lib/omnibus/cli.rb +5 -0
  12. data/lib/omnibus/cli/base.rb +1 -1
  13. data/lib/omnibus/cli/publish.rb +5 -3
  14. data/lib/omnibus/compressors/dmg.rb +2 -2
  15. data/lib/omnibus/config.rb +42 -5
  16. data/lib/omnibus/core_extensions/open_uri.rb +1 -0
  17. data/lib/omnibus/download_helpers.rb +4 -4
  18. data/lib/omnibus/fetchers/git_fetcher.rb +15 -5
  19. data/lib/omnibus/fetchers/net_fetcher.rb +1 -1
  20. data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
  21. data/lib/omnibus/file_syncer.rb +2 -2
  22. data/lib/omnibus/generator_files/omnibus.rb.erb +1 -0
  23. data/lib/omnibus/git_cache.rb +31 -13
  24. data/lib/omnibus/health_check.rb +1 -173
  25. data/lib/omnibus/licensing.rb +48 -7
  26. data/lib/omnibus/manifest.rb +3 -5
  27. data/lib/omnibus/manifest_entry.rb +1 -1
  28. data/lib/omnibus/metadata.rb +2 -1
  29. data/lib/omnibus/packager.rb +3 -1
  30. data/lib/omnibus/packagers/appx.rb +3 -3
  31. data/lib/omnibus/packagers/base.rb +9 -0
  32. data/lib/omnibus/packagers/bff.rb +4 -6
  33. data/lib/omnibus/packagers/deb.rb +95 -1
  34. data/lib/omnibus/packagers/ips.rb +50 -4
  35. data/lib/omnibus/packagers/pkgsrc.rb +112 -0
  36. data/lib/omnibus/packagers/rpm.rb +72 -3
  37. data/lib/omnibus/packagers/solaris.rb +0 -4
  38. data/lib/omnibus/packagers/windows_base.rb +1 -1
  39. data/lib/omnibus/project.rb +13 -3
  40. data/lib/omnibus/publishers/artifactory_publisher.rb +4 -6
  41. data/lib/omnibus/publishers/s3_publisher.rb +8 -3
  42. data/lib/omnibus/reports.rb +1 -1
  43. data/lib/omnibus/s3_cache.rb +18 -5
  44. data/lib/omnibus/s3_helpers.rb +45 -8
  45. data/lib/omnibus/software.rb +55 -37
  46. data/lib/omnibus/sugarable.rb +4 -0
  47. data/lib/omnibus/templating.rb +29 -13
  48. data/lib/omnibus/util.rb +81 -2
  49. data/lib/omnibus/version.rb +1 -1
  50. data/lib/omnibus/whitelist.rb +228 -0
  51. data/omnibus.gemspec +9 -8
  52. data/resources/dmg/create_dmg.osascript.erb +33 -13
  53. data/resources/ips/doc-transform.erb +2 -0
  54. data/resources/rpm/spec.erb +1 -2
  55. data/spec/functional/builder_spec.rb +21 -21
  56. data/spec/functional/fetchers/git_fetcher_spec.rb +6 -6
  57. data/spec/functional/fetchers/net_fetcher_spec.rb +7 -7
  58. data/spec/functional/fetchers/path_fetcher_spec.rb +5 -5
  59. data/spec/functional/file_syncer_spec.rb +6 -6
  60. data/spec/functional/licensing_spec.rb +29 -16
  61. data/spec/functional/templating_spec.rb +23 -22
  62. data/spec/support/git_helpers.rb +30 -24
  63. data/spec/unit/build_version_spec.rb +1 -1
  64. data/spec/unit/builder_spec.rb +36 -24
  65. data/spec/unit/changelogprinter_spec.rb +10 -8
  66. data/spec/unit/cleanroom_spec.rb +6 -6
  67. data/spec/unit/compressors/dmg_spec.rb +23 -37
  68. data/spec/unit/compressors/null_spec.rb +2 -2
  69. data/spec/unit/compressors/tgz_spec.rb +2 -2
  70. data/spec/unit/config_spec.rb +2 -1
  71. data/spec/unit/digestable_spec.rb +2 -2
  72. data/spec/unit/fetchers/git_fetcher_spec.rb +5 -5
  73. data/spec/unit/fetchers/net_fetcher_spec.rb +46 -6
  74. data/spec/unit/fetchers/path_fetcher_spec.rb +5 -5
  75. data/spec/unit/file_syncer_spec.rb +19 -0
  76. data/spec/unit/git_cache_spec.rb +76 -22
  77. data/spec/unit/health_check_spec.rb +1 -1
  78. data/spec/unit/library_spec.rb +2 -2
  79. data/spec/unit/manifest_spec.rb +6 -6
  80. data/spec/unit/metadata_spec.rb +4 -4
  81. data/spec/unit/omnibus_spec.rb +4 -4
  82. data/spec/unit/package_spec.rb +6 -6
  83. data/spec/unit/packagers/appx_spec.rb +16 -12
  84. data/spec/unit/packagers/base_spec.rb +5 -5
  85. data/spec/unit/packagers/bff_spec.rb +45 -15
  86. data/spec/unit/packagers/deb_spec.rb +95 -17
  87. data/spec/unit/packagers/ips_spec.rb +61 -17
  88. data/spec/unit/packagers/makeself_spec.rb +5 -5
  89. data/spec/unit/packagers/msi_spec.rb +43 -43
  90. data/spec/unit/packagers/pkg_spec.rb +15 -15
  91. data/spec/unit/packagers/pkgsrc_spec.rb +77 -0
  92. data/spec/unit/packagers/rpm_spec.rb +94 -17
  93. data/spec/unit/packagers/solaris_spec.rb +11 -11
  94. data/spec/unit/project_spec.rb +53 -22
  95. data/spec/unit/publisher_spec.rb +2 -2
  96. data/spec/unit/publishers/artifactory_publisher_spec.rb +7 -3
  97. data/spec/unit/publishers/s3_publisher_spec.rb +1 -1
  98. data/spec/unit/s3_helpers_spec.rb +41 -3
  99. data/spec/unit/software_spec.rb +115 -37
  100. data/spec/unit/sugarable_spec.rb +23 -3
  101. data/spec/unit/util_spec.rb +42 -11
  102. metadata +49 -29
@@ -30,7 +30,7 @@ module Omnibus
30
30
  create_directory("#{staging_dir}/DEBIAN")
31
31
  end
32
32
 
33
- describe '#vendor' do
33
+ describe "#vendor" do
34
34
  it "is a DSL method" do
35
35
  expect(subject).to have_exposed_method(:vendor)
36
36
  end
@@ -44,7 +44,7 @@ module Omnibus
44
44
  end
45
45
  end
46
46
 
47
- describe '#license' do
47
+ describe "#license" do
48
48
  it "is a DSL method" do
49
49
  expect(subject).to have_exposed_method(:license)
50
50
  end
@@ -66,7 +66,7 @@ module Omnibus
66
66
  end
67
67
  end
68
68
 
69
- describe '#priority' do
69
+ describe "#priority" do
70
70
  it "is a DSL method" do
71
71
  expect(subject).to have_exposed_method(:priority)
72
72
  end
@@ -80,7 +80,7 @@ module Omnibus
80
80
  end
81
81
  end
82
82
 
83
- describe '#section' do
83
+ describe "#section" do
84
84
  it "is a DSL method" do
85
85
  expect(subject).to have_exposed_method(:section)
86
86
  end
@@ -94,13 +94,55 @@ module Omnibus
94
94
  end
95
95
  end
96
96
 
97
- describe '#id' do
97
+ describe "#compression_type" do
98
+ it "is a DSL method" do
99
+ expect(subject).to have_exposed_method(:compression_type)
100
+ end
101
+
102
+ it "has a default value" do
103
+ expect(subject.compression_type).to eq(:gzip)
104
+ end
105
+
106
+ it "must be a symbol" do
107
+ expect { subject.compression_type(Object.new) }.to raise_error(InvalidValue)
108
+ end
109
+ end
110
+
111
+ describe "#compression_level" do
112
+ it "is a DSL method" do
113
+ expect(subject).to have_exposed_method(:compression_level)
114
+ end
115
+
116
+ it "has a default value" do
117
+ expect(subject.compression_level).to eq(9)
118
+ end
119
+
120
+ it "must be a symbol" do
121
+ expect { subject.compression_level(Object.new) }.to raise_error(InvalidValue)
122
+ end
123
+ end
124
+
125
+ describe "#compression_strategy" do
126
+ it "is a DSL method" do
127
+ expect(subject).to have_exposed_method(:compression_strategy)
128
+ end
129
+
130
+ it "has a default value" do
131
+ expect(subject.compression_strategy).to eq(nil)
132
+ end
133
+
134
+ it "must be a symbol" do
135
+ expect { subject.compression_strategy(Object.new) }.to raise_error(InvalidValue)
136
+ end
137
+ end
138
+
139
+ describe "#id" do
98
140
  it "is :deb" do
99
141
  expect(subject.id).to eq(:deb)
100
142
  end
101
143
  end
102
144
 
103
- describe '#package_name' do
145
+ describe "#package_name" do
104
146
  before do
105
147
  allow(subject).to receive(:safe_architecture).and_return("amd64")
106
148
  end
@@ -110,13 +152,13 @@ module Omnibus
110
152
  end
111
153
  end
112
154
 
113
- describe '#debian_dir' do
155
+ describe "#debian_dir" do
114
156
  it "is nested inside the staging_dir" do
115
157
  expect(subject.debian_dir).to eq("#{staging_dir}/DEBIAN")
116
158
  end
117
159
  end
118
160
 
119
- describe '#write_control_file' do
161
+ describe "#write_control_file" do
120
162
  before do
121
163
  allow(subject).to receive(:safe_architecture).and_return("amd64")
122
164
  end
@@ -144,7 +186,7 @@ module Omnibus
144
186
  end
145
187
  end
146
188
 
147
- describe '#write_conffiles_file' do
189
+ describe "#write_conffiles_file" do
148
190
  before do
149
191
  project.config_file("/opt/project/file1")
150
192
  project.config_file("/opt/project/file2")
@@ -173,7 +215,7 @@ module Omnibus
173
215
  end
174
216
  end
175
217
 
176
- describe '#write_scripts' do
218
+ describe "#write_scripts" do
177
219
  before do
178
220
  create_file("#{project_root}/package-scripts/project/preinst") { "preinst" }
179
221
  create_file("#{project_root}/package-scripts/project/postinst") { "postinst" }
@@ -207,7 +249,7 @@ module Omnibus
207
249
  end
208
250
  end
209
251
 
210
- describe '#write_md5_sums' do
252
+ describe "#write_md5_sums" do
211
253
  before do
212
254
  create_file("#{staging_dir}/.filea") { ".filea" }
213
255
  create_file("#{staging_dir}/file1") { "file1" }
@@ -234,7 +276,7 @@ module Omnibus
234
276
  end
235
277
  end
236
278
 
237
- describe '#create_deb_file' do
279
+ describe "#create_deb_file" do
238
280
  before do
239
281
  allow(subject).to receive(:shellout!)
240
282
  allow(Dir).to receive(:chdir) { |_, &b| b.call }
@@ -257,9 +299,45 @@ module Omnibus
257
299
  .with(/dpkg-deb -z9 -Zgzip -D --build/)
258
300
  subject.create_deb_file
259
301
  end
302
+
303
+ describe "when deb compression type xz is configured" do
304
+ before do
305
+ subject.compression_type(:xz)
306
+ end
307
+
308
+ it "uses the correct command for xz" do
309
+ expect(subject).to receive(:shellout!)
310
+ .with(/dpkg-deb -z9 -Zxz -D --build/)
311
+ subject.create_deb_file
312
+ end
313
+
314
+ context "when deb compression level is configured" do
315
+ before do
316
+ subject.compression_level(6)
317
+ end
318
+
319
+ it "uses the correct command for xz" do
320
+ expect(subject).to receive(:shellout!)
321
+ .with(/dpkg-deb -z6 -Zxz -D --build/)
322
+ subject.create_deb_file
323
+ end
324
+ end
325
+
326
+ context "when deb compression strategy is configured" do
327
+ before do
328
+ subject.compression_strategy(:extreme)
329
+ end
330
+
331
+ it "uses the correct command for xz" do
332
+ expect(subject).to receive(:shellout!)
333
+ .with(/dpkg-deb -z9 -Zxz -Sextreme -D --build/)
334
+ subject.create_deb_file
335
+ end
336
+ end
337
+ end
260
338
  end
261
339
 
262
- describe '#package_size' do
340
+ describe "#package_size" do
263
341
  before do
264
342
  project.install_dir(staging_dir)
265
343
 
@@ -272,7 +350,7 @@ module Omnibus
272
350
  end
273
351
  end
274
352
 
275
- describe '#safe_base_package_name' do
353
+ describe "#safe_base_package_name" do
276
354
  context 'when the project name is "safe"' do
277
355
  it "returns the value without logging a message" do
278
356
  expect(subject.safe_base_package_name).to eq("project")
@@ -293,13 +371,13 @@ module Omnibus
293
371
  end
294
372
  end
295
373
 
296
- describe '#safe_build_iteration' do
374
+ describe "#safe_build_iteration" do
297
375
  it "returns the build iteration" do
298
376
  expect(subject.safe_build_iteration).to eq(project.build_iteration)
299
377
  end
300
378
  end
301
379
 
302
- describe '#safe_version' do
380
+ describe "#safe_version" do
303
381
  context 'when the project build_version is "safe"' do
304
382
  it "returns the value without logging a message" do
305
383
  expect(subject.safe_version).to eq("1.2.3")
@@ -332,7 +410,7 @@ module Omnibus
332
410
  end
333
411
  end
334
412
 
335
- describe '#safe_architecture' do
413
+ describe "#safe_architecture" do
336
414
  let(:shellout) { double("Mixlib::ShellOut", :run_command => true, :error! => nil) }
337
415
 
338
416
  before do
@@ -8,7 +8,7 @@ module Omnibus
8
8
  project.name("project")
9
9
  project.homepage("https://example.com")
10
10
  project.install_dir("/opt/project")
11
- project.build_version("1.2.3")
11
+ project.build_version("1.2.3+20161003185500.git.37.089ab3f")
12
12
  project.build_iteration("2")
13
13
  project.maintainer("Chef Software")
14
14
  end
@@ -39,7 +39,7 @@ module Omnibus
39
39
  end
40
40
  end
41
41
 
42
- describe '#publisher_prefix' do
42
+ describe "#publisher_prefix" do
43
43
  it "is a DSL method" do
44
44
  expect(subject).to have_exposed_method(:publisher_prefix)
45
45
  end
@@ -49,47 +49,47 @@ module Omnibus
49
49
  end
50
50
  end
51
51
 
52
- it '#id is :IPS' do
52
+ it "#id is :IPS" do
53
53
  expect(subject.id).to eq(:ips)
54
54
  end
55
55
 
56
- describe '#package_name' do
56
+ describe "#package_name" do
57
57
  it "should create correct package name" do
58
- expect(subject.package_name).to eq("project-1.2.3-2.i386.p5p")
58
+ expect(subject.package_name).to eq("project-1.2.3+20161003185500.git.37.089ab3f-2.i386.p5p")
59
59
  end
60
60
  end
61
61
 
62
- describe '#fmri_package_name' do
62
+ describe "#fmri_package_name" do
63
63
  it "should create correct fmri package name" do
64
64
  expect(subject.fmri_package_name).to eq ("project@1.2.3,5.11-2")
65
65
  end
66
66
  end
67
67
 
68
- describe '#pkg_metadata_file' do
68
+ describe "#pkg_metadata_file" do
69
69
  it "is created inside the staging_dir" do
70
70
  expect(subject.pkg_metadata_file).to eq("#{subject.staging_dir}/gen.manifestfile")
71
71
  end
72
72
  end
73
73
 
74
- describe '#pkg_manifest_file' do
74
+ describe "#pkg_manifest_file" do
75
75
  it "is created inside the staging_dir" do
76
76
  expect(subject.pkg_manifest_file).to eq("#{subject.staging_dir}/#{subject.safe_base_package_name}.p5m")
77
77
  end
78
78
  end
79
79
 
80
- describe '#repo_dir' do
80
+ describe "#repo_dir" do
81
81
  it "is created inside the staging_dir" do
82
82
  expect(subject.repo_dir).to eq("#{subject.staging_dir}/publish/repo")
83
83
  end
84
84
  end
85
85
 
86
- describe '#source_dir' do
86
+ describe "#source_dir" do
87
87
  it "is created inside the staging_dir" do
88
88
  expect(subject.source_dir).to eq("#{subject.staging_dir}/proto_install")
89
89
  end
90
90
  end
91
91
 
92
- describe '#safe_base_package_name' do
92
+ describe "#safe_base_package_name" do
93
93
  context 'when the project name is "safe"' do
94
94
  it "returns the value without logging a message" do
95
95
  expect(subject.safe_base_package_name).to eq("project")
@@ -110,7 +110,7 @@ module Omnibus
110
110
  end
111
111
  end
112
112
 
113
- describe '#safe_architecture' do
113
+ describe "#safe_architecture" do
114
114
  context "the architecture is Intel-based" do
115
115
  let(:architecture) { "i86pc" }
116
116
 
@@ -136,6 +136,16 @@ module Omnibus
136
136
  end
137
137
  end
138
138
 
139
+ describe "#write_versionlock_file" do
140
+ let(:versionlock_file) { File.join(staging_dir, "version-lock") }
141
+
142
+ it "creates the version-lock file" do
143
+ subject.write_versionlock_file
144
+ versionlock_file_contents = File.read(versionlock_file)
145
+ expect(versionlock_file_contents).to include("<transform pkg depend -> default facet.version-lock.*> false>")
146
+ end
147
+ end
148
+
139
149
  describe "#write_transform_file" do
140
150
  let(:transform_file) { File.join(staging_dir, "doc-transform") }
141
151
 
@@ -144,18 +154,50 @@ module Omnibus
144
154
  transform_file_contents = File.read(transform_file)
145
155
  expect(transform_file_contents).to include("<transform dir path=opt$ -> edit group bin sys>")
146
156
  expect(transform_file_contents).to include("<transform file depend -> edit pkg.debug.depend.file ruby env>")
157
+ expect(transform_file_contents).to include("<transform file depend -> edit pkg.debug.depend.file make env>")
158
+ expect(transform_file_contents).to include("<transform file depend -> edit pkg.debug.depend.file perl env>")
147
159
  end
148
160
  end
149
161
 
150
162
  describe "#write_pkg_metadata" do
163
+ let(:resources_path) { File.join(tmp_path, "resources/path") }
164
+ let(:manifest_file) { File.join(staging_dir, "gen.manifestfile") }
165
+
151
166
  it "should create metadata correctly" do
152
167
  subject.write_pkg_metadata
153
- manifest_file = File.join(staging_dir, "gen.manifestfile")
154
- manifest_file_contents = File.read(manifest_file)
155
168
  expect(File.exist?(manifest_file)).to be(true)
169
+ manifest_file_contents = File.read(manifest_file)
156
170
  expect(manifest_file_contents).to include("set name=pkg.fmri value=developer/versioning/project@1.2.3,5.11-2")
157
171
  expect(manifest_file_contents).to include("set name=variant.arch value=i386")
158
172
  end
173
+
174
+ context "when symlinks.erb exists" do
175
+ before do
176
+ FileUtils.mkdir_p(resources_path)
177
+ allow(subject).to receive(:resources_path).and_return(resources_path)
178
+ File.open(File.join(resources_path, "symlinks.erb"), "w+") do |f|
179
+ f.puts("link path=usr/bin/ohai target=<%= projectdir %>/bin/ohai")
180
+ f.puts("link path=<%= projectdir %>/bin/gmake target=<%= projectdir %>/embedded/bin/make")
181
+ end
182
+ end
183
+
184
+ it "should append symlinks to metadata contents" do
185
+ subject.write_pkg_metadata
186
+ expect(File.exist?(manifest_file)).to be(true)
187
+ manifest_file_contents = File.read(manifest_file)
188
+ expect(manifest_file_contents).to include("link path=usr/bin/ohai target=/opt/project/bin/ohai")
189
+ expect(manifest_file_contents).to include("link path=/opt/project/bin/gmake target=/opt/project/embedded/bin/make")
190
+ end
191
+ end
192
+
193
+ context "when symlinks.erb does not exist" do
194
+ it "#write_pkg_metadata does not include symlinks" do
195
+ subject.write_pkg_metadata
196
+ manifest_file = File.join(staging_dir, "gen.manifestfile")
197
+ manifest_file_contents = File.read(manifest_file)
198
+ expect(manifest_file_contents).not_to include("link path=usr/bin/ohai target=/opt/project/bin/ohai")
199
+ end
200
+ end
159
201
  end
160
202
 
161
203
  describe "#generate_pkg_contents" do
@@ -176,6 +218,8 @@ module Omnibus
176
218
  .with("pkgmogrify -DARCH=`uname -p` #{staging_dir}/project.p5m.3 #{staging_dir}/doc-transform | pkgfmt > #{staging_dir}/project.p5m.4")
177
219
  expect(subject).to receive(:shellout!)
178
220
  .with("pkgdepend resolve -m #{staging_dir}/project.p5m.4")
221
+ expect(subject).to receive(:shellout!)
222
+ .with("pkgmogrify #{staging_dir}/project.p5m.4.res #{staging_dir}/version-lock > #{staging_dir}/project.p5m.5.res")
179
223
  subject.generate_pkg_deps
180
224
  end
181
225
  end
@@ -183,7 +227,7 @@ module Omnibus
183
227
  describe "#validate_pkg_manifest" do
184
228
  it "uses the correct commands" do
185
229
  expect(subject).to receive(:shellout!)
186
- .with("pkglint -c /tmp/lint-cache -r http://pkg.oracle.com/solaris/release #{staging_dir}/project.p5m.4.res")
230
+ .with("pkglint -c /tmp/lint-cache -r http://pkg.oracle.com/solaris/release #{staging_dir}/project.p5m.5.res")
187
231
  subject.validate_pkg_manifest
188
232
  end
189
233
  end
@@ -201,7 +245,7 @@ module Omnibus
201
245
  expect(subject).to receive(:shellout!)
202
246
  .with("pkgrepo -s #{staging_dir}/publish/repo set publisher/prefix=Omnibus")
203
247
  expect(subject).to receive(:shellout!)
204
- .with("pkgsend publish -s #{staging_dir}/publish/repo -d #{staging_dir}/proto_install #{staging_dir}/project.p5m.4.res")
248
+ .with("pkgsend publish -s #{staging_dir}/publish/repo -d #{staging_dir}/proto_install #{staging_dir}/project.p5m.5.res")
205
249
 
206
250
  expect(shellout).to receive(:stdout)
207
251
  subject.publish_ips_pkg
@@ -211,7 +255,7 @@ module Omnibus
211
255
  describe "#export_pkg_archive_file" do
212
256
  it "uses the correct commands" do
213
257
  expect(subject).to receive(:shellout!)
214
- .with("pkgrecv -s #{staging_dir}/publish/repo -a -d #{package_dir}/project-1.2.3-2.i386.p5p project")
258
+ .with("pkgrecv -s #{staging_dir}/publish/repo -a -d #{package_dir}/project-1.2.3+20161003185500.git.37.089ab3f-2.i386.p5p project")
215
259
 
216
260
  expect(shellout).to receive(:stdout)
217
261
  subject.export_pkg_archive_file
@@ -27,13 +27,13 @@ module Omnibus
27
27
  create_directory(staging_dir)
28
28
  end
29
29
 
30
- describe '#id' do
30
+ describe "#id" do
31
31
  it "is :makeself" do
32
32
  expect(subject.id).to eq(:makeself)
33
33
  end
34
34
  end
35
35
 
36
- describe '#package_name' do
36
+ describe "#package_name" do
37
37
  before do
38
38
  allow(subject).to receive(:safe_architecture).and_return("x86_64")
39
39
  end
@@ -43,7 +43,7 @@ module Omnibus
43
43
  end
44
44
  end
45
45
 
46
- describe '#write_makeselfinst' do
46
+ describe "#write_makeselfinst" do
47
47
  it "generates the executable file", :not_supported_on_windows do
48
48
  subject.write_makeselfinst
49
49
  expect("#{staging_dir}/makeselfinst").to be_an_executable
@@ -57,7 +57,7 @@ module Omnibus
57
57
  end
58
58
  end
59
59
 
60
- describe '#write_scripts' do
60
+ describe "#write_scripts" do
61
61
  let(:default_scripts) { %w{ postinst } }
62
62
  before do
63
63
  default_scripts.each do |script_name|
@@ -79,7 +79,7 @@ module Omnibus
79
79
  end
80
80
  end
81
81
 
82
- describe '#create_makeself_package' do
82
+ describe "#create_makeself_package" do
83
83
  before do
84
84
  allow(subject).to receive(:shellout!)
85
85
  allow(Dir).to receive(:chdir) { |_, &b| b.call }
@@ -38,27 +38,27 @@ module Omnibus
38
38
  end
39
39
  end
40
40
 
41
- describe '#id' do
41
+ describe "#id" do
42
42
  it "is :pkg" do
43
43
  expect(subject.id).to eq(:msi)
44
44
  end
45
45
  end
46
46
 
47
- describe '#upgrade_code' do
47
+ describe "#upgrade_code" do
48
48
  it "is a DSL method" do
49
49
  expect(subject).to have_exposed_method(:upgrade_code)
50
50
  end
51
51
 
52
52
  it "is required" do
53
- expect {
53
+ expect do
54
54
  subject.upgrade_code
55
- }.to raise_error(MissingRequiredAttribute)
55
+ end.to raise_error(MissingRequiredAttribute)
56
56
  end
57
57
 
58
58
  it "requires the value to be a String" do
59
- expect {
59
+ expect do
60
60
  subject.parameters(Object.new)
61
- }.to raise_error(InvalidValue)
61
+ end.to raise_error(InvalidValue)
62
62
  end
63
63
 
64
64
  it "returns the given value" do
@@ -68,7 +68,7 @@ module Omnibus
68
68
  end
69
69
  end
70
70
 
71
- describe '#parameters' do
71
+ describe "#parameters" do
72
72
  it "is a DSL method" do
73
73
  expect(subject).to have_exposed_method(:parameters)
74
74
  end
@@ -78,9 +78,9 @@ module Omnibus
78
78
  end
79
79
 
80
80
  it "requires the value to be a Hash" do
81
- expect {
81
+ expect do
82
82
  subject.parameters(Object.new)
83
- }.to raise_error(InvalidValue)
83
+ end.to raise_error(InvalidValue)
84
84
  end
85
85
 
86
86
  it "returns the given value" do
@@ -90,7 +90,7 @@ module Omnibus
90
90
  end
91
91
  end
92
92
 
93
- describe '#package_name' do
93
+ describe "#package_name" do
94
94
  before do
95
95
  allow(Config).to receive(:windows_arch).and_return(:foo_arch)
96
96
  end
@@ -105,13 +105,13 @@ module Omnibus
105
105
  end
106
106
  end
107
107
 
108
- describe '#resources_dir' do
108
+ describe "#resources_dir" do
109
109
  it "is nested inside the staging_dir" do
110
110
  expect(subject.resources_dir).to eq("#{staging_dir}/Resources")
111
111
  end
112
112
  end
113
113
 
114
- describe '#write_localization_file' do
114
+ describe "#write_localization_file" do
115
115
  it "generates the file" do
116
116
  subject.write_localization_file
117
117
  expect("#{staging_dir}/localization-en-us.wxl").to be_a_file
@@ -127,7 +127,7 @@ module Omnibus
127
127
  end
128
128
  end
129
129
 
130
- describe '#write_parameters_file' do
130
+ describe "#write_parameters_file" do
131
131
  before do
132
132
  subject.upgrade_code("ABCD-1234")
133
133
  end
@@ -147,7 +147,7 @@ module Omnibus
147
147
  end
148
148
  end
149
149
 
150
- describe '#write_source_file' do
150
+ describe "#write_source_file" do
151
151
  it "generates the file" do
152
152
  subject.write_source_file
153
153
  expect("#{staging_dir}/source.wxs").to be_a_file
@@ -202,7 +202,7 @@ module Omnibus
202
202
  end
203
203
  end
204
204
 
205
- describe '#write_bundle_file' do
205
+ describe "#write_bundle_file" do
206
206
  before do
207
207
  subject.bundle_msi(true)
208
208
  subject.upgrade_code("ABCD-1234")
@@ -223,7 +223,7 @@ module Omnibus
223
223
  end
224
224
  end
225
225
 
226
- describe '#windows_package_version' do
226
+ describe "#windows_package_version" do
227
227
  context "when the project build_version semver" do
228
228
  it "returns the right value" do
229
229
  expect(subject.windows_package_version).to eq("1.2.3.2")
@@ -239,7 +239,7 @@ module Omnibus
239
239
  end
240
240
  end
241
241
 
242
- describe '#msi_display_version' do
242
+ describe "#msi_display_version" do
243
243
  context 'when the project build_version is "safe"' do
244
244
  it "returns the right value" do
245
245
  expect(subject.msi_display_version).to eq("1.2.3")
@@ -255,29 +255,29 @@ module Omnibus
255
255
  end
256
256
  end
257
257
 
258
- describe '#wix_candle_extensions' do
258
+ describe "#wix_candle_extensions" do
259
259
  it "defaults to an empty Array" do
260
260
  expect(subject.wix_candle_extensions).to be_an(Array)
261
261
  expect(subject.wix_candle_extensions).to be_empty
262
262
  end
263
263
  end
264
264
 
265
- describe '#wix_light_extensions' do
265
+ describe "#wix_light_extensions" do
266
266
  it "defaults to an empty Array" do
267
267
  expect(subject.wix_light_extensions).to be_an(Array)
268
268
  expect(subject.wix_light_extensions).to be_empty
269
269
  end
270
270
  end
271
271
 
272
- describe '#wix_candle_extension' do
272
+ describe "#wix_candle_extension" do
273
273
  it "is a DSL method" do
274
274
  expect(subject).to have_exposed_method(:wix_candle_extension)
275
275
  end
276
276
 
277
277
  it "requires the value to be an String" do
278
- expect {
278
+ expect do
279
279
  subject.wix_candle_extension(Object.new)
280
- }.to raise_error(InvalidValue)
280
+ end.to raise_error(InvalidValue)
281
281
  end
282
282
 
283
283
  it "returns the given value" do
@@ -287,15 +287,15 @@ module Omnibus
287
287
  end
288
288
  end
289
289
 
290
- describe '#wix_light_extension' do
290
+ describe "#wix_light_extension" do
291
291
  it "is a DSL method" do
292
292
  expect(subject).to have_exposed_method(:wix_light_extension)
293
293
  end
294
294
 
295
295
  it "requires the value to be an String" do
296
- expect {
296
+ expect do
297
297
  subject.wix_light_extension(Object.new)
298
- }.to raise_error(InvalidValue)
298
+ end.to raise_error(InvalidValue)
299
299
  end
300
300
 
301
301
  it "returns the given value" do
@@ -305,7 +305,7 @@ module Omnibus
305
305
  end
306
306
  end
307
307
 
308
- describe '#wix_extension_switches' do
308
+ describe "#wix_extension_switches" do
309
309
  it "returns an empty string for an empty array" do
310
310
  expect(subject.wix_extension_switches([])).to eq("")
311
311
  end
@@ -319,15 +319,15 @@ module Omnibus
319
319
  end
320
320
  end
321
321
 
322
- describe '#bundle_msi' do
322
+ describe "#bundle_msi" do
323
323
  it "is a DSL method" do
324
324
  expect(subject).to have_exposed_method(:bundle_msi)
325
325
  end
326
326
 
327
327
  it "requires the value to be a TrueClass or a FalseClass" do
328
- expect {
328
+ expect do
329
329
  subject.bundle_msi(Object.new)
330
- }.to raise_error(InvalidValue)
330
+ end.to raise_error(InvalidValue)
331
331
  end
332
332
 
333
333
  it "returns the given value" do
@@ -336,15 +336,15 @@ module Omnibus
336
336
  end
337
337
  end
338
338
 
339
- describe '#fast_msi' do
339
+ describe "#fast_msi" do
340
340
  it "is a DSL method" do
341
341
  expect(subject).to have_exposed_method(:fast_msi)
342
342
  end
343
343
 
344
344
  it "requires the value to be a TrueClass or a FalseClass" do
345
- expect {
345
+ expect do
346
346
  subject.fast_msi(Object.new)
347
- }.to raise_error(InvalidValue)
347
+ end.to raise_error(InvalidValue)
348
348
  end
349
349
 
350
350
  it "returns the given value" do
@@ -353,7 +353,7 @@ module Omnibus
353
353
  end
354
354
  end
355
355
 
356
- describe '#zip_command' do
356
+ describe "#zip_command" do
357
357
  it "returns a String" do
358
358
  expect(subject.zip_command).to be_a(String)
359
359
  end
@@ -363,7 +363,7 @@ module Omnibus
363
363
  end
364
364
  end
365
365
 
366
- describe '#candle_command' do
366
+ describe "#candle_command" do
367
367
  it "returns a String" do
368
368
  expect(subject.candle_command).to be_a(String)
369
369
  end
@@ -393,7 +393,7 @@ module Omnibus
393
393
  end
394
394
  end
395
395
 
396
- describe '#heat_command' do
396
+ describe "#heat_command" do
397
397
  it "returns a String" do
398
398
  expect(subject.heat_command).to be_a(String)
399
399
  end
@@ -423,7 +423,7 @@ module Omnibus
423
423
  end
424
424
  end
425
425
 
426
- describe '#light_command' do
426
+ describe "#light_command" do
427
427
  it "returns a String" do
428
428
  expect(subject.light_command("foo")).to be_a(String)
429
429
  end
@@ -453,7 +453,7 @@ module Omnibus
453
453
  end
454
454
  end
455
455
 
456
- describe '#gem_path' do
456
+ describe "#gem_path" do
457
457
  let(:install_dir) { File.join(tmp_path, "install_dir") }
458
458
 
459
459
  before do
@@ -469,9 +469,9 @@ module Omnibus
469
469
  end
470
470
 
471
471
  it "requires the value to be a String" do
472
- expect {
472
+ expect do
473
473
  subject.gem_path(Object.new)
474
- }.to raise_error(InvalidValue)
474
+ end.to raise_error(InvalidValue)
475
475
  end
476
476
 
477
477
  it "globs for gems under the install directory" do
@@ -509,7 +509,7 @@ module Omnibus
509
509
  allow(subject).to receive(:shellout!)
510
510
  end
511
511
 
512
- describe '#timestamp_servers' do
512
+ describe "#timestamp_servers" do
513
513
  it "defaults to using ['http://timestamp.digicert.com','http://timestamp.verisign.com/scripts/timestamp.dll']" do
514
514
  subject.signing_identity("foo")
515
515
  expect(subject).to receive(:try_sign).with(msi, "http://timestamp.digicert.com").and_return(false)
@@ -517,20 +517,20 @@ module Omnibus
517
517
  subject.sign_package(msi)
518
518
  end
519
519
 
520
- it 'uses the timestamp server if provided through the #timestamp_server dsl' do
520
+ it "uses the timestamp server if provided through the #timestamp_server dsl" do
521
521
  subject.signing_identity("foo", timestamp_servers: "http://fooserver")
522
522
  expect(subject).to receive(:try_sign).with(msi, "http://fooserver").and_return(true)
523
523
  subject.sign_package(msi)
524
524
  end
525
525
 
526
- it 'tries all timestamp server if provided through the #timestamp_server dsl' do
526
+ it "tries all timestamp server if provided through the #timestamp_server dsl" do
527
527
  subject.signing_identity("foo", timestamp_servers: ["http://fooserver", "http://barserver"])
528
528
  expect(subject).to receive(:try_sign).with(msi, "http://fooserver").and_return(false)
529
529
  expect(subject).to receive(:try_sign).with(msi, "http://barserver").and_return(true)
530
530
  subject.sign_package(msi)
531
531
  end
532
532
 
533
- it 'tries all timestamp server if provided through the #timestamp_servers dsl and stops at the first available' do
533
+ it "tries all timestamp server if provided through the #timestamp_servers dsl and stops at the first available" do
534
534
  subject.signing_identity("foo", timestamp_servers: ["http://fooserver", "http://barserver"])
535
535
  expect(subject).to receive(:try_sign).with(msi, "http://fooserver").and_return(true)
536
536
  expect(subject).not_to receive(:try_sign).with(msi, "http://barserver")