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
@@ -8,33 +8,33 @@ module Omnibus
8
8
  describe Templating do
9
9
  subject { RandomClass.new }
10
10
 
11
- describe '#render_template' do
12
- let(:source) { File.join(tmp_path, "source.erb") }
13
- let(:destination) { File.join(tmp_path, "final") }
14
- let(:mode) { 0644 }
15
- let(:variables) { { name: "Name" } }
16
- let(:contents) do
17
- <<-EOH.gsub(/^ {10}/, "")
11
+ let(:source) { File.join(tmp_path, "source.erb") }
12
+ let(:destination) { File.join(tmp_path, "final") }
13
+ let(:mode) { 0644 }
14
+ let(:variables) { { name: "Name" } }
15
+ let(:contents) do
16
+ <<-EOH.gsub(/^ {10}/, "")
18
17
  <%= name %>
19
18
 
20
19
  <% if false -%>
21
20
  This is magic!
22
21
  <% end -%>
23
22
  EOH
24
- end
23
+ end
25
24
 
26
- let(:options) do
27
- {
28
- destination: destination,
29
- variables: variables,
30
- mode: mode,
31
- }
32
- end
25
+ let(:options) do
26
+ {
27
+ destination: destination,
28
+ variables: variables,
29
+ mode: mode,
30
+ }
31
+ end
33
32
 
34
- before do
35
- File.open(source, "w") { |f| f.write(contents) }
36
- end
33
+ before do
34
+ File.open(source, "w") { |f| f.write(contents) }
35
+ end
37
36
 
37
+ describe "#render_template" do
38
38
  context "when no destination is given" do
39
39
  let(:destination) { nil }
40
40
 
@@ -59,24 +59,25 @@ module Omnibus
59
59
  expect(destination).to be_an_executable
60
60
  end
61
61
  end
62
+ end
62
63
 
64
+ describe "#render_template_content" do
63
65
  context "when an undefined variable is used" do
64
66
  let(:contents) { "<%= not_a_real_variable %>" }
65
67
 
66
68
  it "raise an exception" do
67
69
  expect do
68
- subject.render_template(source, options)
70
+ subject.render_template_content(source, variables)
69
71
  end.to raise_error(NameError)
70
72
  end
71
73
  end
72
74
 
73
75
  context "when no variables are present" do
74
- let(:content) { "static content" }
76
+ let(:contents) { "static content" }
75
77
  let(:variables) { {} }
76
78
 
77
79
  it "renders the template" do
78
- subject.render_template(source, options)
79
- expect(destination).to be_a_file
80
+ expect(subject.render_template_content(source, variables)).to eq("static content")
80
81
  end
81
82
  end
82
83
  end
@@ -21,30 +21,36 @@ module Omnibus
21
21
  git %{remote add origin "#{options[:remote]}"} if options[:remote]
22
22
  git %{push origin master}
23
23
 
24
- options[:annotated_tags].each do |tag|
25
- File.open("tag", "w") { |f| f.write(tag) }
26
- git %{add tag}
27
- git %{commit -am "Create tag #{tag}"}
28
- git %{tag "#{tag}" -m "#{tag}"}
29
- git %{push origin "#{tag}"} if options[:remote]
30
- end if options[:annotated_tags]
31
-
32
- options[:tags].each do |tag|
33
- File.open("tag", "w") { |f| f.write(tag) }
34
- git %{add tag}
35
- git %{commit -am "Create tag #{tag}"}
36
- git %{tag "#{tag}"}
37
- git %{push origin "#{tag}"} if options[:remote]
38
- end if options[:tags]
39
-
40
- options[:branches].each do |branch|
41
- git %{checkout -b #{branch} master}
42
- File.open("branch", "w") { |f| f.write(branch) }
43
- git %{add branch}
44
- git %{commit -am "Create branch #{branch}"}
45
- git %{push origin "#{branch}"} if options[:remote]
46
- git %{checkout master}
47
- end if options[:branches]
24
+ if options[:annotated_tags]
25
+ options[:annotated_tags].each do |tag|
26
+ File.open("tag", "w") { |f| f.write(tag) }
27
+ git %{add tag}
28
+ git %{commit -am "Create tag #{tag}"}
29
+ git %{tag "#{tag}" -m "#{tag}"}
30
+ git %{push origin "#{tag}"} if options[:remote]
31
+ end
32
+ end
33
+
34
+ if options[:tags]
35
+ options[:tags].each do |tag|
36
+ File.open("tag", "w") { |f| f.write(tag) }
37
+ git %{add tag}
38
+ git %{commit -am "Create tag #{tag}"}
39
+ git %{tag "#{tag}"}
40
+ git %{push origin "#{tag}"} if options[:remote]
41
+ end
42
+ end
43
+
44
+ if options[:branches]
45
+ options[:branches].each do |branch|
46
+ git %{checkout -b #{branch} master}
47
+ File.open("branch", "w") { |f| f.write(branch) }
48
+ git %{add branch}
49
+ git %{commit -am "Create branch #{branch}"}
50
+ git %{push origin "#{branch}"} if options[:remote]
51
+ git %{checkout master}
52
+ end
53
+ end
48
54
  end
49
55
  path
50
56
  end
@@ -185,7 +185,7 @@ module Omnibus
185
185
  end
186
186
  end
187
187
 
188
- describe '#initialize `path` parameter' do
188
+ describe "#initialize `path` parameter" do
189
189
  let(:path) { "/some/fake/path" }
190
190
  subject(:build_version) { BuildVersion.new(path) }
191
191
 
@@ -28,121 +28,133 @@ module Omnibus
28
28
  end
29
29
  end
30
30
 
31
- describe '#command' do
31
+ describe "#command" do
32
32
  it "is a DSL method" do
33
33
  expect(subject).to have_exposed_method(:command)
34
34
  end
35
35
  end
36
36
 
37
- describe '#workers' do
37
+ describe "#workers" do
38
38
  it "is a DSL method" do
39
39
  expect(subject).to have_exposed_method(:workers)
40
40
  end
41
41
  end
42
42
 
43
- describe '#ruby' do
43
+ describe "#ruby" do
44
44
  it "is a DSL method" do
45
45
  expect(subject).to have_exposed_method(:ruby)
46
46
  end
47
47
  end
48
48
 
49
- describe '#gem' do
49
+ describe "#gem" do
50
50
  it "is a DSL method" do
51
51
  expect(subject).to have_exposed_method(:gem)
52
52
  end
53
53
  end
54
54
 
55
- describe '#bundle' do
55
+ describe "#bundle" do
56
56
  it "is a DSL method" do
57
57
  expect(subject).to have_exposed_method(:bundle)
58
58
  end
59
59
  end
60
60
 
61
- describe '#appbundle' do
61
+ describe "#appbundle" do
62
62
  it "is a DSL method" do
63
63
  expect(subject).to have_exposed_method(:appbundle)
64
64
  end
65
65
  end
66
66
 
67
- describe '#block' do
67
+ describe "#block" do
68
68
  it "is a DSL method" do
69
69
  expect(subject).to have_exposed_method(:block)
70
70
  end
71
71
  end
72
72
 
73
- describe '#erb' do
73
+ describe "#erb" do
74
74
  it "is a DSL method" do
75
75
  expect(subject).to have_exposed_method(:erb)
76
76
  end
77
77
  end
78
78
 
79
- describe '#mkdir' do
79
+ describe "#mkdir" do
80
80
  it "is a DSL method" do
81
81
  expect(subject).to have_exposed_method(:mkdir)
82
82
  end
83
83
  end
84
84
 
85
- describe '#touch' do
85
+ describe "#touch" do
86
86
  it "is a DSL method" do
87
87
  expect(subject).to have_exposed_method(:touch)
88
88
  end
89
89
  end
90
90
 
91
- describe '#delete' do
91
+ describe "#delete" do
92
92
  it "is a DSL method" do
93
93
  expect(subject).to have_exposed_method(:delete)
94
94
  end
95
95
  end
96
96
 
97
- describe '#copy' do
97
+ describe "#strip" do
98
+ it "is a DSL method" do
99
+ expect(subject).to have_exposed_method(:strip)
100
+ end
101
+ end
102
+
103
+ describe "#copy" do
98
104
  it "is a DSL method" do
99
105
  expect(subject).to have_exposed_method(:copy)
100
106
  end
101
107
  end
102
108
 
103
- describe '#move' do
109
+ describe "#move" do
104
110
  it "is a DSL method" do
105
111
  expect(subject).to have_exposed_method(:move)
106
112
  end
107
113
  end
108
114
 
109
- describe '#link' do
115
+ describe "#link" do
110
116
  it "is a DSL method" do
111
117
  expect(subject).to have_exposed_method(:link)
112
118
  end
113
119
  end
114
120
 
115
- describe '#sync' do
121
+ describe "#sync" do
116
122
  it "is a DSL method" do
117
123
  expect(subject).to have_exposed_method(:sync)
118
124
  end
119
125
  end
120
126
 
121
- describe '#update_config_guess' do
127
+ describe "#update_config_guess" do
122
128
  it "is a DSL method" do
123
129
  expect(subject).to have_exposed_method(:update_config_guess)
124
130
  end
125
131
  end
126
132
 
127
- describe '#windows_safe_path' do
133
+ describe "#windows_safe_path" do
128
134
  it "is a DSL method" do
129
135
  expect(subject).to have_exposed_method(:windows_safe_path)
130
136
  end
131
137
  end
132
138
 
133
- describe '#project_dir' do
139
+ describe "#project_dir" do
134
140
  it "is a DSL method" do
135
141
  expect(subject).to have_exposed_method(:project_dir)
136
142
  end
137
143
  end
138
144
 
139
- describe '#install_dir' do
145
+ describe "#install_dir" do
140
146
  it "is a DSL method" do
141
147
  expect(subject).to have_exposed_method(:install_dir)
142
148
  end
143
149
  end
144
150
 
145
- describe '#make' do
151
+ describe "#overrides" do
152
+ it "is a DSL method" do
153
+ expect(subject).to have_exposed_method(:overrides)
154
+ end
155
+ end
156
+
157
+ describe "#make" do
146
158
  before do
147
159
  allow(subject).to receive(:command)
148
160
  end
@@ -205,7 +217,7 @@ module Omnibus
205
217
  end
206
218
  end
207
219
 
208
- describe '#configure' do
220
+ describe "#configure" do
209
221
  before do
210
222
  allow(subject).to receive(:command)
211
223
  end
@@ -287,7 +299,7 @@ module Omnibus
287
299
  end
288
300
  end
289
301
 
290
- describe '#patch' do
302
+ describe "#patch" do
291
303
  before do
292
304
  allow(subject).to receive(:find_file)
293
305
  .with("config/patches", "good_patch")
@@ -331,11 +343,11 @@ module Omnibus
331
343
 
332
344
  describe "#shasum" do
333
345
  let(:build_step) do
334
- Proc.new {
346
+ Proc.new do
335
347
  block do
336
348
  command("true")
337
349
  end
338
- }
350
+ end
339
351
  end
340
352
 
341
353
  let(:tmp_dir) { Dir.mktmpdir }
@@ -14,30 +14,32 @@ module Omnibus
14
14
  })
15
15
  end
16
16
 
17
- let(:changelog) { double(ChangeLog,
17
+ let(:changelog) do
18
+ double(ChangeLog,
18
19
  changelog_entries: %w{entry1 entry2},
19
- authors: %w{alice bob}) }
20
- let(:git_changelog) { double(ChangeLog,
20
+ authors: %w{alice bob}) end
21
+ let(:git_changelog) do
22
+ double(ChangeLog,
21
23
  changelog_entries:
22
- %w{sub-entry1 sub-entry2}) }
24
+ %w{sub-entry1 sub-entry2}) end
23
25
  let(:now) { double(Time) }
24
26
  let(:emptydiff) { EmptyManifestDiff.new }
25
- let(:old_manifest) {
27
+ let(:old_manifest) do
26
28
  m = Manifest.new()
27
29
  m.add("updated-comp", manifest_entry_for("updated-comp", "v9", "v9"))
28
30
  m.add("updated-comp-2", manifest_entry_for("updated-comp-2", "someref0", "someref0", :git))
29
31
  m.add("removed-comp", manifest_entry_for("removed-comp", "v9", "v9"))
30
32
  m.add("removed-comp-2", manifest_entry_for("removed-comp-2", "v10", "v10"))
31
33
  m
32
- }
33
- let(:new_manifest) {
34
+ end
35
+ let(:new_manifest) do
34
36
  m = Manifest.new()
35
37
  m.add("updated-comp", manifest_entry_for("updated-comp", "v10", "v10"))
36
38
  m.add("updated-comp-2", manifest_entry_for("updated-comp-2", "someotherref", "someotherref", :git))
37
39
  m.add("added-comp", manifest_entry_for("added-comp", "v100", "v100"))
38
40
  m.add("added-comp-2", manifest_entry_for("added-comp-2", "v101", "v101"))
39
41
  m
40
- }
42
+ end
41
43
  let(:diff) { ManifestDiff.new(old_manifest, new_manifest) }
42
44
 
43
45
  it "starts with a changelog version header including the time" do
@@ -17,11 +17,11 @@ module Omnibus
17
17
 
18
18
  let(:instance) { klass.new }
19
19
 
20
- describe '#evaluate' do
20
+ describe "#evaluate" do
21
21
  it "exposes public methods" do
22
- expect {
22
+ expect do
23
23
  instance.evaluate("exposed_method")
24
- }.to_not raise_error
24
+ end.to_not raise_error
25
25
  end
26
26
 
27
27
  it "calls exposed methods on the instance" do
@@ -30,13 +30,13 @@ module Omnibus
30
30
  end
31
31
 
32
32
  it "does not expose unexposed methods" do
33
- expect {
33
+ expect do
34
34
  instance.evaluate("unexposed_method")
35
- }.to raise_error(NameError)
35
+ end.to raise_error(NameError)
36
36
  end
37
37
  end
38
38
 
39
- describe '#evaluate_file' do
39
+ describe "#evaluate_file" do
40
40
  let(:contents) do
41
41
  <<-EOH.gsub(/^ {10}/, "")
42
42
  exposed_method
@@ -5,6 +5,7 @@ module Omnibus
5
5
  let(:project) do
6
6
  Project.new.tap do |project|
7
7
  project.name("project")
8
+ project.friendly_name("Project One")
8
9
  project.homepage("https://example.com")
9
10
  project.install_dir("/opt/project")
10
11
  project.build_version("1.2.3")
@@ -33,7 +34,7 @@ module Omnibus
33
34
  allow(subject).to receive(:shellout!)
34
35
  end
35
36
 
36
- describe '#window_bounds' do
37
+ describe "#window_bounds" do
37
38
  it "is a DSL method" do
38
39
  expect(subject).to have_exposed_method(:window_bounds)
39
40
  end
@@ -43,7 +44,7 @@ module Omnibus
43
44
  end
44
45
  end
45
46
 
46
- describe '#pkg_position' do
47
+ describe "#pkg_position" do
47
48
  it "is a DSL method" do
48
49
  expect(subject).to have_exposed_method(:pkg_position)
49
50
  end
@@ -53,19 +54,19 @@ module Omnibus
53
54
  end
54
55
  end
55
56
 
56
- describe '#id' do
57
+ describe "#id" do
57
58
  it "is :dmg" do
58
59
  expect(subject.id).to eq(:dmg)
59
60
  end
60
61
  end
61
62
 
62
- describe '#resources_dir' do
63
+ describe "#resources_dir" do
63
64
  it "is nested inside the staging_dir" do
64
65
  expect(subject.resources_dir).to eq("#{staging_dir}/Resources")
65
66
  end
66
67
  end
67
68
 
68
- describe '#clean_disks' do
69
+ describe "#clean_disks" do
69
70
  it "logs a message" do
70
71
  allow(subject).to receive(:shellout!)
71
72
  .and_return(double(Mixlib::ShellOut, stdout: ""))
@@ -75,7 +76,7 @@ module Omnibus
75
76
  end
76
77
  end
77
78
 
78
- describe '#create_writable_dmg' do
79
+ describe "#create_writable_dmg" do
79
80
  it "logs a message" do
80
81
  output = capture_logging { subject.create_writable_dmg }
81
82
  expect(output).to include("Creating writable dmg")
@@ -86,7 +87,7 @@ module Omnibus
86
87
  .with <<-EOH.gsub(/^ {12}/, "")
87
88
  hdiutil create \\
88
89
  -srcfolder "#{staging_dir}/Resources" \\
89
- -volname "Project" \\
90
+ -volname "Project One" \\
90
91
  -fs HFS+ \\
91
92
  -fsargs "-c c=64,a=16,e=16" \\
92
93
  -format UDRW \\
@@ -98,7 +99,7 @@ module Omnibus
98
99
  end
99
100
  end
100
101
 
101
- describe '#attach_dmg' do
102
+ describe "#attach_dmg" do
102
103
  before do
103
104
  allow(subject).to receive(:shellout!)
104
105
  .and_return(shellout)
@@ -129,7 +130,7 @@ module Omnibus
129
130
  end
130
131
  end
131
132
 
132
- describe '#set_volume_icon' do
133
+ describe "#set_volume_icon" do
133
134
  it "logs a message" do
134
135
  output = capture_logging { subject.set_volume_icon }
135
136
  expect(output).to include("Setting volume icon")
@@ -155,17 +156,17 @@ module Omnibus
155
156
  iconutil -c icns tmp.iconset
156
157
 
157
158
  # Copy it over
158
- cp tmp.icns "/Volumes/Project/.VolumeIcon.icns"
159
+ cp tmp.icns "/Volumes/Project One/.VolumeIcon.icns"
159
160
 
160
161
  # Source the icon
161
- SetFile -a C "/Volumes/Project"
162
+ SetFile -a C "/Volumes/Project One"
162
163
  EOH
163
164
 
164
165
  subject.set_volume_icon
165
166
  end
166
167
  end
167
168
 
168
- describe '#prettify_dmg' do
169
+ describe "#prettify_dmg" do
169
170
  it "logs a message" do
170
171
  output = capture_logging { subject.prettify_dmg }
171
172
  expect(output).to include("Making the dmg all pretty and stuff")
@@ -180,23 +181,9 @@ module Omnibus
180
181
  subject.prettify_dmg
181
182
  contents = File.read("#{staging_dir}/create_dmg.osascript")
182
183
 
183
- expect(contents).to include('tell application "Finder"')
184
- expect(contents).to include(' tell disk "Project"')
185
- expect(contents).to include(" open")
186
- expect(contents).to include(" set current view of container window to icon view")
187
- expect(contents).to include(" set toolbar visible of container window to false")
188
- expect(contents).to include(" set statusbar visible of container window to false")
189
- expect(contents).to include(" set the bounds of container window to {100, 100, 750, 600}")
190
- expect(contents).to include(" set theViewOptions to the icon view options of container window")
191
- expect(contents).to include(" set arrangement of theViewOptions to not arranged")
192
- expect(contents).to include(" set icon size of theViewOptions to 72")
193
- expect(contents).to include(' set background picture of theViewOptions to file ".support:background.png"')
194
- expect(contents).to include(" delay 5")
195
- expect(contents).to include(' set position of item "project-1.2.3-2.pkg" of container window to {535, 50}')
196
- expect(contents).to include(" update without registering applications")
197
- expect(contents).to include(" delay 5")
198
- expect(contents).to include(" end tell")
199
- expect(contents).to include("end tell")
184
+ expect(contents).to include('set found_disk to do shell script "ls /Volumes/ | grep \'Project One*\'"')
185
+ expect(contents).to include(" set the bounds of Finder window 1 to {100, 100, 750, 600}")
186
+ expect(contents).to include(' set position of item "project-1.2.3-2.pkg" of container window to {535, 50}')
200
187
  end
201
188
 
202
189
  it "runs the apple script" do
@@ -209,7 +196,7 @@ module Omnibus
209
196
  end
210
197
  end
211
198
 
212
- describe '#compress_dmg' do
199
+ describe "#compress_dmg" do
213
200
  it "logs a message" do
214
201
  output = capture_logging { subject.compress_dmg }
215
202
  expect(output).to include("Compressing dmg")
@@ -221,7 +208,7 @@ module Omnibus
221
208
 
222
209
  expect(subject).to receive(:shellout!)
223
210
  .with <<-EOH.gsub(/^ {12}/, "")
224
- chmod -Rf go-w /Volumes/Project
211
+ chmod -Rf go-w "/Volumes/Project One"
225
212
  sync
226
213
  hdiutil detach "#{device}"
227
214
  hdiutil convert \\
@@ -237,7 +224,7 @@ module Omnibus
237
224
  end
238
225
  end
239
226
 
240
- describe '#set_dmg_icon' do
227
+ describe "#set_dmg_icon" do
241
228
  it "logs a message" do
242
229
  output = capture_logging { subject.set_dmg_icon }
243
230
  expect(output).to include("Setting dmg icon")
@@ -265,7 +252,7 @@ module Omnibus
265
252
  end
266
253
  end
267
254
 
268
- describe '#package_name' do
255
+ describe "#package_name" do
269
256
  it 'reflects the packager\'s unmodified package_name' do
270
257
  expect(subject.package_name).to eq("project-1.2.3-2.dmg")
271
258
  end
@@ -279,7 +266,7 @@ module Omnibus
279
266
  end
280
267
  end
281
268
 
282
- describe '#writable_dmg' do
269
+ describe "#writable_dmg" do
283
270
  it "is in the staging_dir" do
284
271
  expect(subject.writable_dmg).to include(staging_dir)
285
272
  end
@@ -289,10 +276,9 @@ module Omnibus
289
276
  end
290
277
  end
291
278
 
292
- describe '#volume_name' do
279
+ describe "#volume_name" do
293
280
  it "is the project friendly_name" do
294
- project.friendly_name("Friendly Bacon Bits")
295
- expect(subject.volume_name).to eq("Friendly Bacon Bits")
281
+ expect(subject.volume_name).to eq("Project One")
296
282
  end
297
283
  end
298
284
  end