cfa 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cfa/augeas_parser.rb +5 -3
- data/lib/cfa/augeas_parser/writer.rb +7 -5
- 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: 20d0d56ba26b5b824817fedbd1dd5111952bfc15
|
4
|
+
data.tar.gz: a3d8b0c17b1727c18ee25aea940db711a7d5714c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa97b3fed3d901bc8901d58d57b4612d4455b0a4552d4e90c190865c0a1bd62627ff8e36accf05cbb8efa9855b8b36a2551de482ce31451f85dfd3eb70f47138
|
7
|
+
data.tar.gz: f6a930470d3151060eb00e0f24d5f7cbb0db0f103e13ab84997a7dc04fef1098cd99d0cdf5b949061174cbf386fbefa42328270beb1ba9e2b655c40bdf68a1df
|
data/lib/cfa/augeas_parser.rb
CHANGED
@@ -147,7 +147,7 @@ module CFA
|
|
147
147
|
# @return [Array<Hash{Symbol => Object}>] a frozen array as it is
|
148
148
|
# just a copy of the real data
|
149
149
|
def data
|
150
|
-
@data.
|
150
|
+
@data.reject { |e| e[:operation] == :remove }.freeze
|
151
151
|
end
|
152
152
|
|
153
153
|
# low level access to all AugeasElement including ones marked for removal
|
@@ -238,8 +238,10 @@ module CFA
|
|
238
238
|
return false if self.class != other.class
|
239
239
|
other_data = other.data # do not compute again
|
240
240
|
data.each_with_index do |entry, index|
|
241
|
-
|
242
|
-
return false
|
241
|
+
other_entry = other_data[index]
|
242
|
+
return false unless other_entry
|
243
|
+
return false if entry[:key] != other_entry[:key]
|
244
|
+
return false if entry[:value] != other_entry[:value]
|
243
245
|
end
|
244
246
|
|
245
247
|
true
|
@@ -236,11 +236,13 @@ module CFA
|
|
236
236
|
# @see https://github.com/hercules-team/augeas/wiki/Path-expressions
|
237
237
|
def set_new_value(path, located_entry)
|
238
238
|
aug.set(path, located_entry.entry_value)
|
239
|
-
|
240
|
-
#
|
241
|
-
#
|
242
|
-
#
|
243
|
-
|
239
|
+
# we need to get new path as path used in aug.set can contains
|
240
|
+
# "[last() + 1]", so adding subtree to it, adds additional entry.
|
241
|
+
# So here, we replace "[last() + 1]" with "[last()]" so it will match
|
242
|
+
# path created by previous aug.set
|
243
|
+
match_str = path.gsub(/\[\s*last\(\)\s*\+\s*1\]/, "[last()]")
|
244
|
+
|
245
|
+
new_path = aug.match(match_str).first
|
244
246
|
add_subtree(located_entry.entry_tree, new_path)
|
245
247
|
end
|
246
248
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Reidinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-augeas
|