hieracles 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/Rakefile +1 -1
- data/lib/hieracles/formats/rawyaml.rb +0 -4
- data/lib/hieracles/formats/yaml.rb +25 -25
- data/spec/lib/formats/rawyaml_spec.rb +28 -16
- data/spec/lib/formats/yaml_spec.rb +35 -16
- data/{bin → tools}/nodeinfo +0 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a85430681b128f7d7d677ced8d3a826b95ea42b
|
4
|
+
data.tar.gz: 7ada85e7170ed548503c90e42a857bda38770cc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85178885c1f4a84dddf34f9e0bed2fbb70e688340360773ab99937c052c9f3bf96b16af6111fcb2acfd711d218b7253a76fed0add77f71aa6fb0278da27d9c8c
|
7
|
+
data.tar.gz: d7913dcc5d768381888148244e501d9a8c4e01b79f8fe7f6d31d3a1021e0a1ccc1167e4cb7e3b8114f81999b2b9e7e1f5f3b02c5307b1f94e379b3d74643d1f3
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
Hieracles Changelog
|
2
2
|
=======================
|
3
3
|
|
4
|
-
### 0.0.
|
4
|
+
### 0.0.3 - 2015-09-21
|
5
|
+
- preparing hieracles to be packageable for debian
|
6
|
+
|
7
|
+
### 0.0.2 - 2015-09-16
|
5
8
|
- added `yaml` format including comments about where the params is defined
|
6
9
|
- the uncommented yaml is now the format `rawyaml`
|
7
10
|
|
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'rspec/core/rake_task'
|
|
6
6
|
desc 'launch rspec tests'
|
7
7
|
task :spec do
|
8
8
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
9
|
-
t.rspec_opts = ['-c', '-f
|
9
|
+
t.rspec_opts = ['-c', '-f progress', '-r ./spec/spec_helper.rb']
|
10
10
|
t.pattern = 'spec/lib/**/*_spec.rb'
|
11
11
|
end
|
12
12
|
end
|
@@ -27,11 +27,6 @@ module Hieracles
|
|
27
27
|
commented_yaml_tree(false)
|
28
28
|
end
|
29
29
|
|
30
|
-
def modules(args)
|
31
|
-
@node.modules.to_yaml
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
30
|
def commented_yaml_tree(without_common = true)
|
36
31
|
tree = @node.params_tree(without_common)
|
37
32
|
params = Hash[@node.params(without_common)]
|
@@ -40,26 +35,31 @@ module Hieracles
|
|
40
35
|
|
41
36
|
def mergetree(output, key, leaf, params)
|
42
37
|
indent = ' ' * key.count
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
38
|
+
send("add_#{leaf.class.name.downcase}".to_sym, output, key, leaf, params, indent)
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_hash(output, key, leaf, params, indent)
|
42
|
+
leaf.each do |k, v|
|
43
|
+
output += "\n" + indent + k + ': '
|
44
|
+
output = mergetree(output, key + [k], v, params)
|
45
|
+
end
|
46
|
+
output
|
47
|
+
end
|
48
|
+
|
49
|
+
def add_array(output, key, leaf, params, indent)
|
50
|
+
yaml = leaf.to_yaml[4..-1]
|
51
|
+
aryaml = yaml.each_line.map do |l|
|
52
|
+
indent + l
|
53
|
+
end
|
54
|
+
output += "\n" + indent + "# " + params[key.join('.')][0][:file]
|
55
|
+
output += "\n" + aryaml.join().chomp
|
56
|
+
output
|
57
|
+
end
|
58
|
+
|
59
|
+
def add_string(output, key, leaf, params, indent)
|
60
|
+
output += leaf
|
61
|
+
if params["#{key.join('.')}"]
|
62
|
+
output += " # " + params[key.join('.')][0][:file]
|
63
63
|
end
|
64
64
|
output
|
65
65
|
end
|
@@ -14,9 +14,7 @@ describe Hieracles::Formats::Rawyaml do
|
|
14
14
|
}
|
15
15
|
)
|
16
16
|
}
|
17
|
-
it
|
18
|
-
expect(yaml_format.info nil).to eq expected
|
19
|
-
end
|
17
|
+
it { expect(yaml_format.info nil).to eq expected }
|
20
18
|
end
|
21
19
|
|
22
20
|
describe ".files" do
|
@@ -24,9 +22,7 @@ describe Hieracles::Formats::Rawyaml do
|
|
24
22
|
before {
|
25
23
|
allow(node).to receive(:files).and_return(['path1', 'path2'])
|
26
24
|
}
|
27
|
-
it
|
28
|
-
expect(yaml_format.files nil).to eq expected
|
29
|
-
end
|
25
|
+
it { expect(yaml_format.files nil).to eq expected }
|
30
26
|
end
|
31
27
|
|
32
28
|
describe ".paths" do
|
@@ -34,12 +30,11 @@ describe Hieracles::Formats::Rawyaml do
|
|
34
30
|
before {
|
35
31
|
allow(node).to receive(:paths).and_return(['path1', 'path2'])
|
36
32
|
}
|
37
|
-
it
|
38
|
-
expect(yaml_format.paths nil).to eq expected
|
39
|
-
end
|
33
|
+
it { expect(yaml_format.paths nil).to eq expected }
|
40
34
|
end
|
41
35
|
|
42
36
|
describe ".modules" do
|
37
|
+
let(:expected) { "---\nmodule1: value\nlongmodule2: not found\n" }
|
43
38
|
before {
|
44
39
|
allow(node).to receive(:modules).and_return(
|
45
40
|
{
|
@@ -48,13 +43,31 @@ describe Hieracles::Formats::Rawyaml do
|
|
48
43
|
}
|
49
44
|
)
|
50
45
|
}
|
51
|
-
|
52
|
-
it "outputs proper text" do
|
53
|
-
expect(yaml_format.modules nil).to eq expected
|
54
|
-
end
|
46
|
+
it { expect(yaml_format.modules nil).to eq expected }
|
55
47
|
end
|
56
48
|
|
57
49
|
describe ".params" do
|
50
|
+
let(:expected) {
|
51
|
+
"---\n" +
|
52
|
+
"params:\n" +
|
53
|
+
" this:\n" +
|
54
|
+
" var: value1\n"
|
55
|
+
}
|
56
|
+
before {
|
57
|
+
allow(node).to receive(:params_tree).and_return(
|
58
|
+
{
|
59
|
+
'params' => {
|
60
|
+
'this' => {
|
61
|
+
'var' => 'value1'
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
)
|
66
|
+
}
|
67
|
+
it { expect(yaml_format.params nil).to eq expected }
|
68
|
+
end
|
69
|
+
|
70
|
+
describe ".allparams" do
|
58
71
|
let(:expected) {
|
59
72
|
"---\n"+
|
60
73
|
"params:\n" +
|
@@ -72,8 +85,7 @@ describe Hieracles::Formats::Rawyaml do
|
|
72
85
|
}
|
73
86
|
)
|
74
87
|
}
|
75
|
-
it
|
76
|
-
expect(yaml_format.params nil).to eq expected
|
77
|
-
end
|
88
|
+
it { expect(yaml_format.allparams nil).to eq expected }
|
78
89
|
end
|
90
|
+
|
79
91
|
end
|
@@ -14,9 +14,7 @@ describe Hieracles::Formats::Yaml do
|
|
14
14
|
}
|
15
15
|
)
|
16
16
|
}
|
17
|
-
it
|
18
|
-
expect(yaml_format.info nil).to eq expected
|
19
|
-
end
|
17
|
+
it { expect(yaml_format.info nil).to eq expected }
|
20
18
|
end
|
21
19
|
|
22
20
|
describe ".files" do
|
@@ -24,9 +22,7 @@ describe Hieracles::Formats::Yaml do
|
|
24
22
|
before {
|
25
23
|
allow(node).to receive(:files).and_return(['path1', 'path2'])
|
26
24
|
}
|
27
|
-
it
|
28
|
-
expect(yaml_format.files nil).to eq expected
|
29
|
-
end
|
25
|
+
it { expect(yaml_format.files nil).to eq expected }
|
30
26
|
end
|
31
27
|
|
32
28
|
describe ".paths" do
|
@@ -34,12 +30,11 @@ describe Hieracles::Formats::Yaml do
|
|
34
30
|
before {
|
35
31
|
allow(node).to receive(:paths).and_return(['path1', 'path2'])
|
36
32
|
}
|
37
|
-
it
|
38
|
-
expect(yaml_format.paths nil).to eq expected
|
39
|
-
end
|
33
|
+
it { expect(yaml_format.paths nil).to eq expected }
|
40
34
|
end
|
41
35
|
|
42
36
|
describe ".modules" do
|
37
|
+
let(:expected) { "---\nmodule1: value\nlongmodule2: not found\n" }
|
43
38
|
before {
|
44
39
|
allow(node).to receive(:modules).and_return(
|
45
40
|
{
|
@@ -48,13 +43,39 @@ describe Hieracles::Formats::Yaml do
|
|
48
43
|
}
|
49
44
|
)
|
50
45
|
}
|
51
|
-
|
52
|
-
it "outputs proper text" do
|
53
|
-
expect(yaml_format.modules nil).to eq expected
|
54
|
-
end
|
46
|
+
it { expect(yaml_format.modules nil).to eq expected }
|
55
47
|
end
|
56
48
|
|
57
49
|
describe ".params" do
|
50
|
+
let(:expected) {
|
51
|
+
"---\n" +
|
52
|
+
"params: \n" +
|
53
|
+
" this: \n" +
|
54
|
+
" var: value1 # some/file"
|
55
|
+
}
|
56
|
+
before {
|
57
|
+
allow(node).to receive(:params).and_return(
|
58
|
+
{
|
59
|
+
'params.this.var' => [{
|
60
|
+
file: 'some/file',
|
61
|
+
value: 'value1'
|
62
|
+
}]
|
63
|
+
}
|
64
|
+
)
|
65
|
+
allow(node).to receive(:params_tree).and_return(
|
66
|
+
{
|
67
|
+
'params' => {
|
68
|
+
'this' => {
|
69
|
+
'var' => 'value1'
|
70
|
+
}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
)
|
74
|
+
}
|
75
|
+
it { expect(yaml_format.params nil).to eq expected }
|
76
|
+
end
|
77
|
+
|
78
|
+
describe ".allparams" do
|
58
79
|
let(:expected) {
|
59
80
|
"---\n"+
|
60
81
|
"params: \n" +
|
@@ -80,9 +101,7 @@ describe Hieracles::Formats::Yaml do
|
|
80
101
|
}
|
81
102
|
)
|
82
103
|
}
|
83
|
-
it
|
84
|
-
expect(yaml_format.params nil).to eq expected
|
85
|
-
end
|
104
|
+
it { expect(yaml_format.allparams nil).to eq expected }
|
86
105
|
end
|
87
106
|
|
88
107
|
describe '.mergetree' do
|
data/{bin → tools}/nodeinfo
RENAMED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hieracles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mose
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -127,7 +127,6 @@ files:
|
|
127
127
|
- README.md
|
128
128
|
- Rakefile
|
129
129
|
- bin/hc
|
130
|
-
- bin/nodeinfo
|
131
130
|
- hieracles.gemspec
|
132
131
|
- lib/hieracles.rb
|
133
132
|
- lib/hieracles/config.rb
|
@@ -175,6 +174,7 @@ files:
|
|
175
174
|
- spec/lib/utils_spec.rb
|
176
175
|
- spec/spec_helper.rb
|
177
176
|
- tools/completion/_hc
|
177
|
+
- tools/nodeinfo
|
178
178
|
homepage: https://github.com/Gandi/hieracles
|
179
179
|
licenses:
|
180
180
|
- MIT
|
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
196
|
version: '0'
|
197
197
|
requirements: []
|
198
198
|
rubyforge_project:
|
199
|
-
rubygems_version: 2.4.
|
199
|
+
rubygems_version: 2.4.8
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: CLI tool for Hiera parameters visualisation.
|