bosh-workspace 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bosh/workspace/project_deployment.rb +11 -2
- data/lib/bosh/workspace/version.rb +1 -1
- data/spec/project_deployment_spec.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 290b3ecf5a7051d219af45ab33a538491527f1a3
|
4
|
+
data.tar.gz: 1d7cc914221bbacb25461533a5f5eca4083b6267
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcdb19410a9cc91a8d8d1aa8ab97b2a092e45e16e6dd856203584221722220428bbbf595cf89d904f2745c9a6addaa9ac043cb0584cbafb6443bd491aac815be
|
7
|
+
data.tar.gz: 6033879b801cdcaa201e3d526ce0bb2eb2782ff9c7b5ebfe50d80b91870e94891e7af5d888e6c1f8fdb8c5a497f84b56389b0792081dfd62023dbdd2e8ed3da0
|
@@ -13,12 +13,21 @@ module Bosh::Workspace
|
|
13
13
|
}
|
14
14
|
end
|
15
15
|
|
16
|
-
|
16
|
+
class StemcellVersionValidator < Membrane::Schemas::Base
|
17
|
+
def validate(object)
|
18
|
+
return if object.is_a? Integer
|
19
|
+
return if object.is_a? Float
|
20
|
+
return if object == "latest"
|
21
|
+
return if object.to_s =~ /^\d+\.\d+$/
|
22
|
+
raise Membrane::SchemaValidationError.new(
|
23
|
+
"Should match: latest, version.patch or version. Given: #{object}")
|
24
|
+
end
|
25
|
+
end
|
17
26
|
|
18
27
|
STEMCELL_SCHEMA = Membrane::SchemaParser.parse do
|
19
28
|
{
|
20
29
|
"name" => String,
|
21
|
-
"version" =>
|
30
|
+
"version" => StemcellVersionValidator.new
|
22
31
|
}
|
23
32
|
end
|
24
33
|
|
@@ -123,18 +123,25 @@ describe Bosh::Workspace::ProjectDeployment do
|
|
123
123
|
it { should_not match(/version/i) }
|
124
124
|
end
|
125
125
|
|
126
|
-
context "patch version" do
|
126
|
+
context "patch version string" do
|
127
127
|
let(:missing) { "name" }
|
128
128
|
let(:stemcell_version) { "2719.1" }
|
129
129
|
it { should match(/name.*missing/i) }
|
130
130
|
it { should_not match(/version/i) }
|
131
131
|
end
|
132
132
|
|
133
|
+
context "patch version float" do
|
134
|
+
let(:missing) { "name" }
|
135
|
+
let(:stemcell_version) { 2719.1 }
|
136
|
+
it { should match(/name.*missing/i) }
|
137
|
+
it { should_not match(/version/i) }
|
138
|
+
end
|
139
|
+
|
133
140
|
context "invalid version" do
|
134
141
|
let(:missing) { "name" }
|
135
142
|
let(:stemcell_version) { "foo" }
|
136
143
|
it { should match(/name.*missing/i) }
|
137
|
-
it { should match(/version.*
|
144
|
+
it { should match(/version.*should match/i) }
|
138
145
|
end
|
139
146
|
end
|
140
147
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-workspace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruben Koster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bosh_cli
|