vanagon 0.15.38 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/build +4 -25
- data/bin/build_host_info +4 -17
- data/bin/build_requirements +4 -31
- data/bin/inspect +4 -21
- data/bin/render +4 -22
- data/bin/ship +4 -28
- data/bin/sign +4 -11
- data/bin/vanagon +7 -0
- data/lib/vanagon.rb +1 -1
- data/lib/vanagon/cli.rb +94 -0
- data/lib/vanagon/cli/build.rb +75 -0
- data/lib/vanagon/cli/build_host_info.rb +49 -0
- data/lib/vanagon/cli/build_requirements.rb +60 -0
- data/lib/vanagon/cli/inspect.rb +65 -0
- data/lib/vanagon/cli/render.rb +51 -0
- data/lib/vanagon/cli/ship.rb +52 -0
- data/lib/vanagon/cli/sign.rb +34 -0
- data/lib/vanagon/driver.rb +10 -6
- data/lib/vanagon/engine/docker.rb +101 -14
- data/lib/vanagon/platform.rb +3 -0
- data/lib/vanagon/platform/dsl.rb +11 -0
- data/spec/lib/vanagon/cli_spec.rb +80 -0
- data/spec/lib/vanagon/engine/docker_spec.rb +74 -16
- metadata +54 -31
- data/lib/vanagon/optparse.rb +0 -86
- data/spec/lib/vanagon/optparse_spec.rb +0 -64
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'vanagon/optparse'
|
2
|
-
|
3
|
-
describe Vanagon::OptParse do
|
4
|
-
|
5
|
-
describe "options that don't take a value" do
|
6
|
-
[:skipcheck, :verbose].each do |flag|
|
7
|
-
it "can create an option parser that accepts the #{flag} flag" do
|
8
|
-
subject = described_class.new("test", [flag])
|
9
|
-
expect(subject.parse!(["--#{flag}"])).to have_key(flag)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
describe "short options" do
|
14
|
-
[["v", :verbose]].each do |short, long|
|
15
|
-
it "maps the short option #{short} to #{long}" do
|
16
|
-
subject = described_class.new("test", [long])
|
17
|
-
expect(subject.parse!(["-#{short}"])).to include(long => true)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe "options that only allow limited values" do
|
24
|
-
[[:preserve, ["always", "never", "on-failure"]]].each do |option, values|
|
25
|
-
values.each do |value|
|
26
|
-
it "can create a parser that accepts \"--#{option} #{value}\"" do
|
27
|
-
subject = described_class.new("test", [option, value])
|
28
|
-
expect(subject.parse!(["--#{option}", value])).to eq(option => value.to_sym)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
[[:preserve, ["bad-argument"]]].each do |option, values|
|
33
|
-
values.each do |value|
|
34
|
-
it "rejects the bad argument \"--#{option} #{value}\"" do
|
35
|
-
subject = described_class.new("test", [option, value])
|
36
|
-
expect{subject.parse!(["--#{option}", value])}.to raise_error(OptionParser::InvalidArgument)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
it "preserve defaults to :on-failure" do
|
41
|
-
subject = described_class.new("test")
|
42
|
-
expect(subject.parse!([])).to include(:preserve => :'on-failure')
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
|
47
|
-
describe "options that take a value" do
|
48
|
-
[:workdir, :configdir, :engine].each do |option|
|
49
|
-
it "can create an option parser that accepts the #{option} option" do
|
50
|
-
subject = described_class.new("test", [option])
|
51
|
-
expect(subject.parse!(["--#{option}", "hello"])).to include(option => "hello")
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe "short options" do
|
56
|
-
[["w", :workdir], ["c", :configdir], ["e", :engine]].each do |short, long|
|
57
|
-
it "maps the short option #{short} to #{long}" do
|
58
|
-
subject = described_class.new("test", [long])
|
59
|
-
expect(subject.parse!(["-#{short}", "hello"])).to include(long => "hello")
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|