vanagon 0.15.38 → 0.18.1
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/README.md +48 -23
- 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/extras/completions/vanagon.bash +38 -0
- data/extras/completions/vanagon.zsh +41 -0
- data/lib/vanagon.rb +1 -1
- data/lib/vanagon/cli.rb +102 -0
- data/lib/vanagon/cli/build.rb +83 -0
- data/lib/vanagon/cli/build_host_info.rb +57 -0
- data/lib/vanagon/cli/build_requirements.rb +68 -0
- data/lib/vanagon/cli/completion.rb +43 -0
- data/lib/vanagon/cli/inspect.rb +73 -0
- data/lib/vanagon/cli/list.rb +75 -0
- data/lib/vanagon/cli/render.rb +59 -0
- data/lib/vanagon/cli/ship.rb +52 -0
- data/lib/vanagon/cli/sign.rb +34 -0
- data/lib/vanagon/driver.rb +35 -27
- data/lib/vanagon/engine/always_be_scheduling.rb +271 -1
- data/lib/vanagon/engine/docker.rb +101 -14
- data/lib/vanagon/engine/pooler.rb +7 -3
- data/lib/vanagon/platform.rb +3 -0
- data/lib/vanagon/platform/deb.rb +2 -0
- data/lib/vanagon/platform/dsl.rb +11 -0
- data/lib/vanagon/utilities.rb +30 -8
- data/resources/osx/postinstall.erb +1 -1
- data/resources/solaris/10/postinstall.erb +1 -1
- data/spec/lib/vanagon/cli_spec.rb +226 -0
- data/spec/lib/vanagon/driver_spec.rb +1 -1
- data/spec/lib/vanagon/engine/always_be_scheduling_spec.rb +113 -1
- data/spec/lib/vanagon/engine/docker_spec.rb +74 -16
- data/spec/lib/vanagon/engine/ec2_spec.rb +2 -0
- data/spec/lib/vanagon/engine/pooler_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +61 -34
- 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
|