structurebutcher 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/structurebutcher.rb +15 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a99db9d04f702bb44f5c57cf78854c348cb9f39e
|
4
|
+
data.tar.gz: 5fb7630a82a66c40af57fd743201dab002711ce5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5153756f0c7fa0b3045efa4fd53443e0380aa6301eb91bb5d7cda82b8bc8c632b77cdf04385989f11871ac19d3f3150e04efcfd28d4a8d9a748f089f4370135
|
7
|
+
data.tar.gz: 8913a701324f13fc6f2025eeb2b6766d4462ae0ab975235494e959e82f647a177a63a021b3dd780e9db654193f0d02f0a7625700a420652fcccb57d0d18e0c7e
|
data/lib/structurebutcher.rb
CHANGED
@@ -25,7 +25,10 @@ class StructureButcher
|
|
25
25
|
last_key = keys.pop
|
26
26
|
area = body
|
27
27
|
while (key = keys.shift)
|
28
|
-
|
28
|
+
if area.has_key?(key)
|
29
|
+
then area[key] = {}
|
30
|
+
end
|
31
|
+
area = area[key]
|
29
32
|
end
|
30
33
|
area[last_key] = part
|
31
34
|
end
|
@@ -52,6 +55,17 @@ class StructureButcher
|
|
52
55
|
storer = StructureButcher::Storer.new
|
53
56
|
storer.save_structure(body, body_file, "yaml")
|
54
57
|
end
|
58
|
+
|
59
|
+
def implantate_struct_into_file(body_file, slot, part_struct)
|
60
|
+
parser = StructureButcher::Parser.new
|
61
|
+
body = parser.load_structure(body_file, "yaml")
|
62
|
+
|
63
|
+
butcher = StructureButcher.new
|
64
|
+
butcher.implantate(body, slot, part_struct)
|
65
|
+
|
66
|
+
storer = StructureButcher::Storer.new
|
67
|
+
storer.save_structure(body, body_file, "yaml")
|
68
|
+
end
|
55
69
|
end
|
56
70
|
|
57
71
|
class StructureButcher::Parser
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: structurebutcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miroslav Tynovsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.0.2
|
55
|
-
description:
|
55
|
+
description: Read a config file and write it to a YAML file under specific key
|
56
56
|
email: tynovsky@avast.com
|
57
57
|
executables: []
|
58
58
|
extensions: []
|