omnibus 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +26 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +6 -0
- data/.travis.yml +7 -1
- data/CHANGELOG.md +24 -0
- data/MAINTAINERS.md +5 -5
- data/README.md +2 -2
- data/appveyor.yml +2 -0
- data/features/commands/build.feature +40 -6
- data/features/commands/clean.feature +2 -2
- data/features/commands/manifest.feature +131 -0
- data/features/step_definitions/generator_steps.rb +23 -7
- data/lib/omnibus.rb +3 -0
- data/lib/omnibus/cli.rb +20 -0
- data/lib/omnibus/download_helpers.rb +137 -0
- data/lib/omnibus/fetchers/git_fetcher.rb +8 -1
- data/lib/omnibus/fetchers/net_fetcher.rb +8 -81
- data/lib/omnibus/health_check.rb +54 -1
- data/lib/omnibus/licensing.rb +172 -4
- data/lib/omnibus/packager.rb +1 -0
- data/lib/omnibus/packagers/bff.rb +8 -2
- data/lib/omnibus/packagers/deb.rb +2 -24
- data/lib/omnibus/packagers/rpm.rb +1 -1
- data/lib/omnibus/project.rb +7 -0
- data/lib/omnibus/software.rb +72 -21
- data/lib/omnibus/version.rb +1 -1
- data/omnibus.gemspec +2 -1
- data/spec/functional/licensing_spec.rb +109 -13
- data/spec/unit/health_check_spec.rb +4 -2
- data/spec/unit/packagers/deb_spec.rb +26 -85
- data/spec/unit/packagers/rpm_spec.rb +12 -2
- data/spec/unit/software_spec.rb +154 -15
- metadata +24 -5
@@ -10,11 +10,13 @@ module Omnibus
|
|
10
10
|
project.build_version('1.2.3')
|
11
11
|
project.build_iteration('2')
|
12
12
|
project.maintainer('Chef Software')
|
13
|
+
project.license(project_license) if project_license
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
16
17
|
subject { described_class.new(project) }
|
17
18
|
|
19
|
+
let(:project_license) { nil }
|
18
20
|
let(:project_root) { File.join(tmp_path, 'project/root') }
|
19
21
|
let(:package_dir) { File.join(tmp_path, 'package/dir') }
|
20
22
|
let(:staging_dir) { File.join(tmp_path, 'staging/dir') }
|
@@ -48,12 +50,20 @@ module Omnibus
|
|
48
50
|
end
|
49
51
|
|
50
52
|
it 'has a default value' do
|
51
|
-
expect(subject.license).to eq('
|
53
|
+
expect(subject.license).to eq('Unspecified')
|
52
54
|
end
|
53
55
|
|
54
56
|
it 'must be a string' do
|
55
57
|
expect { subject.license(Object.new) }.to raise_error(InvalidValue)
|
56
58
|
end
|
59
|
+
|
60
|
+
context 'with project license' do
|
61
|
+
let(:project_license) { 'custom-license' }
|
62
|
+
|
63
|
+
it 'uses project license' do
|
64
|
+
expect(subject.license).to eq('custom-license')
|
65
|
+
end
|
66
|
+
end
|
57
67
|
end
|
58
68
|
|
59
69
|
describe '#priority' do
|
@@ -107,6 +117,10 @@ module Omnibus
|
|
107
117
|
end
|
108
118
|
|
109
119
|
describe '#write_control_file' do
|
120
|
+
before do
|
121
|
+
allow(subject).to receive(:safe_architecture).and_return("amd64")
|
122
|
+
end
|
123
|
+
|
110
124
|
it 'generates the file' do
|
111
125
|
subject.write_control_file
|
112
126
|
expect("#{staging_dir}/DEBIAN/control").to be_a_file
|
@@ -118,7 +132,7 @@ module Omnibus
|
|
118
132
|
|
119
133
|
expect(contents).to include("Package: project")
|
120
134
|
expect(contents).to include("Version: 1.2.3")
|
121
|
-
expect(contents).to include("License:
|
135
|
+
expect(contents).to include("License: Unspecified")
|
122
136
|
expect(contents).to include("Vendor: Omnibus <omnibus@getchef.com>")
|
123
137
|
expect(contents).to include("Architecture: amd64")
|
124
138
|
expect(contents).to include("Maintainer: Chef Software")
|
@@ -224,6 +238,7 @@ module Omnibus
|
|
224
238
|
before do
|
225
239
|
allow(subject).to receive(:shellout!)
|
226
240
|
allow(Dir).to receive(:chdir) { |_, &b| b.call }
|
241
|
+
allow(subject).to receive(:safe_architecture).and_return("amd64")
|
227
242
|
end
|
228
243
|
|
229
244
|
it 'logs a message' do
|
@@ -318,94 +333,20 @@ module Omnibus
|
|
318
333
|
end
|
319
334
|
|
320
335
|
describe '#safe_architecture' do
|
321
|
-
|
322
|
-
before do
|
323
|
-
stub_ohai(platform: 'ubuntu', version: '12.04') do |data|
|
324
|
-
data['kernel']['machine'] = 'x86_64'
|
325
|
-
end
|
326
|
-
end
|
327
|
-
|
328
|
-
it 'returns amd64' do
|
329
|
-
expect(subject.safe_architecture).to eq('amd64')
|
330
|
-
end
|
331
|
-
end
|
332
|
-
|
333
|
-
context 'when not 64-bit' do
|
334
|
-
before do
|
335
|
-
stub_ohai(platform: 'ubuntu', version: '12.04') do |data|
|
336
|
-
data['kernel']['machine'] = 'i386'
|
337
|
-
end
|
338
|
-
end
|
339
|
-
|
340
|
-
it 'returns the value' do
|
341
|
-
expect(subject.safe_architecture).to eq('i386')
|
342
|
-
end
|
343
|
-
end
|
344
|
-
|
345
|
-
context 'when i686' do
|
346
|
-
before do
|
347
|
-
stub_ohai(platform: 'ubuntu', version: '12.04') do |data|
|
348
|
-
data['kernel']['machine'] = 'i686'
|
349
|
-
end
|
350
|
-
end
|
336
|
+
let(:shellout) { double("Mixlib::ShellOut", :run_command => true, :error! => nil) }
|
351
337
|
|
352
|
-
|
353
|
-
|
354
|
-
end
|
338
|
+
before do
|
339
|
+
allow(Mixlib::ShellOut).to receive(:new).and_return(shellout)
|
355
340
|
end
|
356
341
|
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
data['kernel']['machine'] = 'ppc64le'
|
361
|
-
end
|
362
|
-
end
|
363
|
-
|
364
|
-
it 'returns ppc64el' do
|
365
|
-
expect(subject.safe_architecture).to eq('ppc64el')
|
366
|
-
end
|
342
|
+
it "shells out to dpkg and returns the output" do
|
343
|
+
allow(shellout).to receive(:stdout).and_return("test_arch\n")
|
344
|
+
expect(subject.safe_architecture).to eq("test_arch")
|
367
345
|
end
|
368
346
|
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
# There's no Raspbian in Fauxhai :(
|
373
|
-
stub_ohai(platform: 'debian', version: '7.6') do |data|
|
374
|
-
data['platform'] = 'raspbian'
|
375
|
-
data['platform_version'] = '7.6'
|
376
|
-
data['kernel']['machine'] = 'armv6l'
|
377
|
-
end
|
378
|
-
end
|
379
|
-
|
380
|
-
it 'returns armhf' do
|
381
|
-
expect(subject.safe_architecture).to eq('armhf')
|
382
|
-
end
|
383
|
-
end
|
384
|
-
|
385
|
-
context 'Ubuntu on Pi v2' do
|
386
|
-
before do
|
387
|
-
# There's no Raspbian in Fauxhai :(
|
388
|
-
stub_ohai(platform: 'ubuntu', version: '14.04') do |data|
|
389
|
-
data['kernel']['machine'] = 'armv7l'
|
390
|
-
end
|
391
|
-
end
|
392
|
-
|
393
|
-
it 'returns armhf' do
|
394
|
-
expect(subject.safe_architecture).to eq('armhf')
|
395
|
-
end
|
396
|
-
end
|
397
|
-
end
|
398
|
-
|
399
|
-
context '64bit ARM platform' do
|
400
|
-
before do
|
401
|
-
stub_ohai(platform: 'ubuntu', version: '14.04') do |data|
|
402
|
-
data['kernel']['machine'] = 'aarch64'
|
403
|
-
end
|
404
|
-
end
|
405
|
-
|
406
|
-
it 'returns arm64' do
|
407
|
-
expect(subject.safe_architecture).to eq('arm64')
|
408
|
-
end
|
347
|
+
it "returns noarch if no architecture is returned by dpkg" do
|
348
|
+
allow(shellout).to receive(:stdout).and_return("")
|
349
|
+
expect(subject.safe_architecture).to eq("noarch")
|
409
350
|
end
|
410
351
|
end
|
411
352
|
end
|
@@ -11,11 +11,13 @@ module Omnibus
|
|
11
11
|
project.build_iteration('2')
|
12
12
|
project.maintainer('Chef Software')
|
13
13
|
project.replace('old-project')
|
14
|
+
project.license(project_license) if project_license
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
17
18
|
subject { described_class.new(project) }
|
18
19
|
|
20
|
+
let(:project_license) { nil }
|
19
21
|
let(:project_root) { File.join(tmp_path, 'project/root') }
|
20
22
|
let(:package_dir) { File.join(tmp_path, 'package/dir') }
|
21
23
|
let(:staging_dir) { File.join(tmp_path, 'staging/dir') }
|
@@ -69,12 +71,20 @@ module Omnibus
|
|
69
71
|
end
|
70
72
|
|
71
73
|
it 'has a default value' do
|
72
|
-
expect(subject.license).to eq('
|
74
|
+
expect(subject.license).to eq('Unspecified')
|
73
75
|
end
|
74
76
|
|
75
77
|
it 'must be a string' do
|
76
78
|
expect { subject.license(Object.new) }.to raise_error(InvalidValue)
|
77
79
|
end
|
80
|
+
|
81
|
+
context 'with project license' do
|
82
|
+
let(:project_license) { 'custom-license' }
|
83
|
+
|
84
|
+
it 'uses project license' do
|
85
|
+
expect(subject.license).to eq('custom-license')
|
86
|
+
end
|
87
|
+
end
|
78
88
|
end
|
79
89
|
|
80
90
|
describe '#priority' do
|
@@ -173,7 +183,7 @@ module Omnibus
|
|
173
183
|
expect(contents).to include("BuildRoot: %buildroot")
|
174
184
|
expect(contents).to include("Prefix: /")
|
175
185
|
expect(contents).to include("Group: default")
|
176
|
-
expect(contents).to include("License:
|
186
|
+
expect(contents).to include("License: Unspecified")
|
177
187
|
expect(contents).to include("Vendor: Omnibus <omnibus@getchef.com>")
|
178
188
|
expect(contents).to include("URL: https://example.com")
|
179
189
|
expect(contents).to include("Packager: Chef Software")
|
data/spec/unit/software_spec.rb
CHANGED
@@ -131,9 +131,58 @@ module Omnibus
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
-
context 'on
|
134
|
+
context 'on solaris_11' do
|
135
|
+
before do
|
136
|
+
stub_ohai(platform: 'solaris2', version: '5.11') do |data|
|
137
|
+
# For some reason, this isn't set in Fauxhai
|
138
|
+
data['platform'] = 'solaris2'
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'sets the defaults' do
|
143
|
+
expect(subject.with_standard_compiler_flags).to eq(
|
144
|
+
"CC" => "gcc -m64 -static-libgcc",
|
145
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O2",
|
146
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O2",
|
147
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O2",
|
148
|
+
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib -static-libgcc",
|
149
|
+
"LD_OPTIONS" => "-R/opt/project/embedded/lib",
|
150
|
+
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
151
|
+
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig"
|
152
|
+
)
|
153
|
+
end
|
154
|
+
|
155
|
+
context 'when loader mapping file is specified' do
|
156
|
+
# Let the unit tests run on windows where auto-path translation occurs.
|
157
|
+
let(:project_root) { File.join(tmp_path, '/root/project') }
|
158
|
+
before do
|
159
|
+
stub_ohai(platform: 'solaris2', version: '5.11') do |data|
|
160
|
+
# For some reason, this isn't set in Fauxhai
|
161
|
+
data['platform'] = 'solaris2'
|
162
|
+
end
|
163
|
+
Config.project_root(project_root)
|
164
|
+
Config.solaris_linker_mapfile('files/mapfile/solaris')
|
165
|
+
allow(File).to receive(:exist?).and_return(true)
|
166
|
+
end
|
167
|
+
|
168
|
+
it 'sets LD_OPTIONS correctly' do
|
169
|
+
expect(subject.with_standard_compiler_flags).to eq(
|
170
|
+
"CC" => "gcc -m64 -static-libgcc",
|
171
|
+
"CFLAGS" => "-I/opt/project/embedded/include -O2",
|
172
|
+
"CPPFLAGS" => "-I/opt/project/embedded/include -O2",
|
173
|
+
"CXXFLAGS" => "-I/opt/project/embedded/include -O2",
|
174
|
+
"LDFLAGS" => "-Wl,-rpath,/opt/project/embedded/lib -L/opt/project/embedded/lib -static-libgcc",
|
175
|
+
"LD_OPTIONS" => "-R/opt/project/embedded/lib",
|
176
|
+
"LD_RUN_PATH" => "/opt/project/embedded/lib",
|
177
|
+
"PKG_CONFIG_PATH" => "/opt/project/embedded/lib/pkgconfig"
|
178
|
+
)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
context 'on solaris_10' do
|
135
184
|
before do
|
136
|
-
stub_ohai(platform: 'solaris2', version: '5.
|
185
|
+
stub_ohai(platform: 'solaris2', version: '5.10') do |data|
|
137
186
|
# For some reason, this isn't set in Fauxhai
|
138
187
|
data['platform'] = 'solaris2'
|
139
188
|
end
|
@@ -156,7 +205,7 @@ module Omnibus
|
|
156
205
|
# Let the unit tests run on windows where auto-path translation occurs.
|
157
206
|
let(:project_root) { File.join(tmp_path, '/root/project') }
|
158
207
|
before do
|
159
|
-
stub_ohai(platform: 'solaris2', version: '5.
|
208
|
+
stub_ohai(platform: 'solaris2', version: '5.10') do |data|
|
160
209
|
# For some reason, this isn't set in Fauxhai
|
161
210
|
data['platform'] = 'solaris2'
|
162
211
|
end
|
@@ -235,6 +284,24 @@ module Omnibus
|
|
235
284
|
'PKG_CONFIG_PATH' => '/opt/project/embedded/lib/pkgconfig',
|
236
285
|
)
|
237
286
|
end
|
287
|
+
|
288
|
+
context 'with gcc 4.9 installed' do
|
289
|
+
before do
|
290
|
+
allow(subject).to receive(:which).and_return('/usr/local/bin/gcc49')
|
291
|
+
end
|
292
|
+
|
293
|
+
it 'sets the compiler args' do
|
294
|
+
expect(subject.with_standard_compiler_flags).to eq(
|
295
|
+
'CC' => 'gcc49',
|
296
|
+
'CXX' => 'g++49',
|
297
|
+
'CFLAGS' => '-I/opt/project/embedded/include -O2',
|
298
|
+
'CXXFLAGS' => '-I/opt/project/embedded/include -O2',
|
299
|
+
'CPPFLAGS' => '-I/opt/project/embedded/include -O2',
|
300
|
+
'LDFLAGS' => '-L/opt/project/embedded/lib',
|
301
|
+
'LD_RUN_PATH' => '/opt/project/embedded/lib',
|
302
|
+
'PKG_CONFIG_PATH' => '/opt/project/embedded/lib/pkgconfig', )
|
303
|
+
end
|
304
|
+
end
|
238
305
|
end
|
239
306
|
|
240
307
|
context 'on freebsd 10' do
|
@@ -267,9 +334,9 @@ module Omnibus
|
|
267
334
|
context 'in 32-bit mode' do
|
268
335
|
it 'sets the default' do
|
269
336
|
expect(subject.with_standard_compiler_flags).to eq(
|
270
|
-
'CFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -
|
271
|
-
'CXXFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -
|
272
|
-
'CPPFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -
|
337
|
+
'CFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -march=i686',
|
338
|
+
'CXXFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -march=i686',
|
339
|
+
'CPPFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -march=i686',
|
273
340
|
'LDFLAGS' => '-L/opt/project/embedded/lib -m32',
|
274
341
|
'LD_RUN_PATH' => '/opt/project/embedded/lib',
|
275
342
|
'PKG_CONFIG_PATH' => '/opt/project/embedded/lib/pkgconfig'
|
@@ -278,9 +345,9 @@ module Omnibus
|
|
278
345
|
|
279
346
|
it 'sets BFD flags if requested' do
|
280
347
|
expect(subject.with_standard_compiler_flags({}, bfd_flags: true)).to eq(
|
281
|
-
'CFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -
|
282
|
-
'CXXFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -
|
283
|
-
'CPPFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -
|
348
|
+
'CFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -march=i686',
|
349
|
+
'CXXFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -march=i686',
|
350
|
+
'CPPFLAGS' => '-I/opt/project/embedded/include -m32 -O3 -march=i686',
|
284
351
|
'LDFLAGS' => '-L/opt/project/embedded/lib -m32',
|
285
352
|
'RCFLAGS' => '--target=pe-i386',
|
286
353
|
'ARFLAGS' => '--target=pe-i386',
|
@@ -295,9 +362,9 @@ module Omnibus
|
|
295
362
|
|
296
363
|
it 'sets the default' do
|
297
364
|
expect(subject.with_standard_compiler_flags).to eq(
|
298
|
-
'CFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -
|
299
|
-
'CXXFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -
|
300
|
-
'CPPFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -
|
365
|
+
'CFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -march=x86-64',
|
366
|
+
'CXXFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -march=x86-64',
|
367
|
+
'CPPFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -march=x86-64',
|
301
368
|
'LDFLAGS' => '-L/opt/project/embedded/lib -m64',
|
302
369
|
'LD_RUN_PATH' => '/opt/project/embedded/lib',
|
303
370
|
'PKG_CONFIG_PATH' => '/opt/project/embedded/lib/pkgconfig'
|
@@ -306,9 +373,9 @@ module Omnibus
|
|
306
373
|
|
307
374
|
it 'sets BFD flags if requested' do
|
308
375
|
expect(subject.with_standard_compiler_flags({}, bfd_flags: true)).to eq(
|
309
|
-
'CFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -
|
310
|
-
'CXXFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -
|
311
|
-
'CPPFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -
|
376
|
+
'CFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -march=x86-64',
|
377
|
+
'CXXFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -march=x86-64',
|
378
|
+
'CPPFLAGS' => '-I/opt/project/embedded/include -m64 -O3 -march=x86-64',
|
312
379
|
'LDFLAGS' => '-L/opt/project/embedded/lib -m64',
|
313
380
|
'RCFLAGS' => '--target=pe-x86-64',
|
314
381
|
'ARFLAGS' => '--target=pe-x86-64',
|
@@ -549,6 +616,64 @@ module Omnibus
|
|
549
616
|
end
|
550
617
|
end
|
551
618
|
|
619
|
+
context 'when software source is a github spec' do
|
620
|
+
let(:source) do
|
621
|
+
{
|
622
|
+
github: 'chef/ohai'
|
623
|
+
}
|
624
|
+
end
|
625
|
+
|
626
|
+
it 'fetches from a fully expanded git path' do
|
627
|
+
expect(subject.source).to eq(git: "https://github.com/chef/ohai.git")
|
628
|
+
expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://github.com/chef/ohai.git").and_return("1.2.8")
|
629
|
+
subject.send(:fetcher)
|
630
|
+
end
|
631
|
+
|
632
|
+
context 'and override source is a git spec' do
|
633
|
+
before { project.override(:software, source: { git: "https://blah.com/git.git" }) }
|
634
|
+
|
635
|
+
it 'fetches from the override path' do
|
636
|
+
expect(subject.source).to eq(git: "https://blah.com/git.git")
|
637
|
+
expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://blah.com/git.git").and_return("1.2.8")
|
638
|
+
subject.send(:fetcher)
|
639
|
+
end
|
640
|
+
end
|
641
|
+
|
642
|
+
context 'and override source is a github spec' do
|
643
|
+
before { project.override(:software, source: { github: "a/b" }) }
|
644
|
+
|
645
|
+
it 'fetches from the override path' do
|
646
|
+
expect(subject.source).to eq(git: "https://github.com/a/b.git")
|
647
|
+
expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://github.com/a/b.git").and_return("1.2.8")
|
648
|
+
subject.send(:fetcher)
|
649
|
+
end
|
650
|
+
end
|
651
|
+
end
|
652
|
+
|
653
|
+
context 'when software source is a git spec' do
|
654
|
+
let(:source) do
|
655
|
+
{
|
656
|
+
git: "https://blah.com/git.git"
|
657
|
+
}
|
658
|
+
end
|
659
|
+
|
660
|
+
it 'fetches from the git spec' do
|
661
|
+
expect(subject.source).to eq(git: "https://blah.com/git.git")
|
662
|
+
expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://blah.com/git.git").and_return("1.2.8")
|
663
|
+
subject.send(:fetcher)
|
664
|
+
end
|
665
|
+
|
666
|
+
context 'and override source is a github spec' do
|
667
|
+
before { project.override(:software, source: { github: "a/b" }) }
|
668
|
+
|
669
|
+
it 'fetches from the override path' do
|
670
|
+
expect(subject.source).to eq(git: "https://github.com/a/b.git")
|
671
|
+
expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", git: "https://github.com/a/b.git").and_return("1.2.8")
|
672
|
+
subject.send(:fetcher)
|
673
|
+
end
|
674
|
+
end
|
675
|
+
end
|
676
|
+
|
552
677
|
describe '#fetcher' do
|
553
678
|
before do
|
554
679
|
expect(Omnibus::Fetcher).to receive(:resolve_version).with("1.2.3", source).and_return("1.2.8")
|
@@ -659,6 +784,20 @@ module Omnibus
|
|
659
784
|
end
|
660
785
|
end
|
661
786
|
|
787
|
+
describe "#canonicalize_source" do
|
788
|
+
it 'canonicalize_source(github: "chef/chef") yields git: "https://github.com/chef/chef.git"' do
|
789
|
+
expect(subject.send(:canonicalize_source, github: "chef/chef")).to eq(git: "https://github.com/chef/chef.git")
|
790
|
+
end
|
791
|
+
it 'canonicalize_source(github: "chef/chef", submodules: true) yields git: "https://github.com/chef/chef.git", submodules: true' do
|
792
|
+
expect(subject.send(:canonicalize_source, github: "chef/chef", submodules: true)).to eq(git: "https://github.com/chef/chef.git", submodules: true)
|
793
|
+
end
|
794
|
+
it 'canonicalize_source does not overwrite the original' do
|
795
|
+
original = { github: "chef/chef", submodules: true }
|
796
|
+
expect(subject.send(:canonicalize_source, original)).to eq(git: "https://github.com/chef/chef.git", submodules: true)
|
797
|
+
expect(original).to eq(github: "chef/chef", submodules: true)
|
798
|
+
end
|
799
|
+
end
|
800
|
+
|
662
801
|
describe '#shasum' do
|
663
802
|
context 'when a filepath is given' do
|
664
803
|
let(:path) { '/software.rb' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omnibus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-sugar
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: '2
|
173
|
+
version: '3.2'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: '2
|
180
|
+
version: '3.2'
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rspec
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,6 +248,20 @@ dependencies:
|
|
248
248
|
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: '0'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: pry
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - ">="
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '0'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - ">="
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
251
265
|
description: Omnibus is a framework for building self-installing, full-stack software
|
252
266
|
builds.
|
253
267
|
email: releng@getchef.com
|
@@ -256,6 +270,8 @@ executables:
|
|
256
270
|
extensions: []
|
257
271
|
extra_rdoc_files: []
|
258
272
|
files:
|
273
|
+
- ".github/ISSUE_TEMPLATE.md"
|
274
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
259
275
|
- ".gitignore"
|
260
276
|
- ".rspec"
|
261
277
|
- ".rubocop.yml"
|
@@ -276,6 +292,7 @@ files:
|
|
276
292
|
- features/commands/build.feature
|
277
293
|
- features/commands/clean.feature
|
278
294
|
- features/commands/list.feature
|
295
|
+
- features/commands/manifest.feature
|
279
296
|
- features/commands/new.feature
|
280
297
|
- features/commands/publish.feature
|
281
298
|
- features/commands/version.feature
|
@@ -304,6 +321,7 @@ files:
|
|
304
321
|
- lib/omnibus/core_extensions.rb
|
305
322
|
- lib/omnibus/core_extensions/open_uri.rb
|
306
323
|
- lib/omnibus/digestable.rb
|
324
|
+
- lib/omnibus/download_helpers.rb
|
307
325
|
- lib/omnibus/exceptions.rb
|
308
326
|
- lib/omnibus/fetcher.rb
|
309
327
|
- lib/omnibus/fetchers/git_fetcher.rb
|
@@ -479,7 +497,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
479
497
|
version: '0'
|
480
498
|
requirements: []
|
481
499
|
rubyforge_project:
|
482
|
-
rubygems_version: 2.
|
500
|
+
rubygems_version: 2.6.1
|
483
501
|
signing_key:
|
484
502
|
specification_version: 4
|
485
503
|
summary: Omnibus is a framework for building self-installing, full-stack software
|
@@ -488,6 +506,7 @@ test_files:
|
|
488
506
|
- features/commands/build.feature
|
489
507
|
- features/commands/clean.feature
|
490
508
|
- features/commands/list.feature
|
509
|
+
- features/commands/manifest.feature
|
491
510
|
- features/commands/new.feature
|
492
511
|
- features/commands/publish.feature
|
493
512
|
- features/commands/version.feature
|