server-blender-manifest 0.0.15 → 0.0.16
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.
- data/VERSION +1 -1
- data/lib/blender/manifest/matchers.rb +66 -0
- data/lib/blender/manifest/root.rb +2 -1
- data/server-blender-manifest.gemspec +3 -2
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.16
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Blender
|
2
|
+
module Manifest
|
3
|
+
module Matchers
|
4
|
+
extend Spec::Matchers::DSL
|
5
|
+
|
6
|
+
RESOURCE_PARAMS = { :exec =>
|
7
|
+
[
|
8
|
+
:command, :creates, :cwd, :env, :environment, :group, :logoutput,
|
9
|
+
:onlyif, :path, :refresh, :refreshonly, :returns, :timeout, :unless,
|
10
|
+
:user, :logfile
|
11
|
+
], :file =>
|
12
|
+
[
|
13
|
+
:backup, :checksum, :content, :ensure, :force, :group, :ignore, :links,
|
14
|
+
:mode, :owner, :path, :purge, :recurse, :recurselimit, :replace,
|
15
|
+
:selrange, :selrole, :seltype, :seluser, :source, :sourceselect,
|
16
|
+
:target, :type
|
17
|
+
], :package =>
|
18
|
+
[
|
19
|
+
:adminfile, :allowcdrom, :category, :configfiles, :description,
|
20
|
+
:ensure, :instance, :platform, :responsefile, :root, :source, :status,
|
21
|
+
:type, :vendor
|
22
|
+
], :service =>
|
23
|
+
[
|
24
|
+
:binary, :control, :enable, :ensure, :hasrestart, :hasstatus,
|
25
|
+
:manifest, :path, :pattern, :restart, :start, :status, :stop,
|
26
|
+
]
|
27
|
+
}
|
28
|
+
|
29
|
+
RESOURCE_PARAMS.each do |resource, matcher_args|
|
30
|
+
define "have_#{resource}".to_sym do |name|
|
31
|
+
matcher_args.each do |arg|
|
32
|
+
chain(arg) {|val| instance_variable_set("@#{arg}", val)}
|
33
|
+
end
|
34
|
+
|
35
|
+
match do |manifest|
|
36
|
+
res = true
|
37
|
+
|
38
|
+
@should = "manifest shold have #{resource} #{name}"
|
39
|
+
@should_not = "manifest shold have #{resource} #{name}"
|
40
|
+
|
41
|
+
res &&= !!(instance = manifest.send(resource.to_s.pluralize)[name])
|
42
|
+
|
43
|
+
matcher_args.each do |attr|
|
44
|
+
if res && (expected = instance_variable_get("@#{attr}"))
|
45
|
+
actual = instance.send(attr)
|
46
|
+
m = " #{attr} #{expected.inspect}"
|
47
|
+
e = " (found #{attr} #{actual.inspect})"
|
48
|
+
@should_not << m
|
49
|
+
unless res &&= expected == actual
|
50
|
+
@should << m << e
|
51
|
+
@should_not << e
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
res
|
58
|
+
end
|
59
|
+
|
60
|
+
failure_message_for_should { |manifest| @should }
|
61
|
+
failure_message_for_should_not { |manifest| @should_not }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{server-blender-manifest}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.16"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Vitaly Kushner"]
|
12
|
-
s.date = %q{2010-07-
|
12
|
+
s.date = %q{2010-07-05}
|
13
13
|
s.description = %q{This gem is part of the server-blender family (http://astrails.com/opensource/server-blender)
|
14
14
|
It contains server-side root manifest implementation for blender recipes. See server-blender for more information.
|
15
15
|
}
|
@@ -25,6 +25,7 @@ It contains server-side root manifest implementation for blender recipes. See se
|
|
25
25
|
"Rakefile",
|
26
26
|
"VERSION",
|
27
27
|
"lib/blender/manifest.rb",
|
28
|
+
"lib/blender/manifest/matchers.rb",
|
28
29
|
"lib/blender/manifest/mixer.rb",
|
29
30
|
"lib/blender/manifest/nodes.rb",
|
30
31
|
"lib/blender/manifest/roles.rb",
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 16
|
9
|
+
version: 0.0.16
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Vitaly Kushner
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-05 00:00:00 +03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -50,6 +50,7 @@ files:
|
|
50
50
|
- Rakefile
|
51
51
|
- VERSION
|
52
52
|
- lib/blender/manifest.rb
|
53
|
+
- lib/blender/manifest/matchers.rb
|
53
54
|
- lib/blender/manifest/mixer.rb
|
54
55
|
- lib/blender/manifest/nodes.rb
|
55
56
|
- lib/blender/manifest/roles.rb
|