cfa 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd707324d0e3ad8265613743072f4557a1907be8c4db9074e323134eaa7acfe6
4
- data.tar.gz: 0a7fc0fb5020ce4edbad0f47f6124b28904fdd039f8ccf0382e7781688f35a50
3
+ metadata.gz: bb1b7fa6df8016efdaa72096f38b083b336a02e5c66daae550c7bcb8d4f97b03
4
+ data.tar.gz: 6b962269233a54a85e20244c68e478b6972b3b63b24d3a27820a35d642c5823e
5
5
  SHA512:
6
- metadata.gz: b5b04935b9112cad8cbe806d6a23d3933d27c1ee2a6c0d198e92a30a72e493d9034883424e1e46301b740eea7e49f6324ec3d7c760ca0cc58c1f13e487d9e53b
7
- data.tar.gz: 42c7343d2933ad4ef95d363ccbaf55d9d366d35ef98eb7cc0dfc4d506b52f2cc0044f085afd0bb9754c9653f47fde430eeb332e23e8f66b84410a09819f02bad
6
+ metadata.gz: 8066f5355f28a46197ebc7ddf67db6aaf3e29f834d094db92006480a233794288cf0d902cc967af2c2f02fda79bb6ff3c6c4b6ef0f8ffe0c24a27e54b5cd616f
7
+ data.tar.gz: 1f863794c77fa3a1ba6f9e90de407dd33d3b9b4ac5fa7e1af7752110358bb36aeeadc60eea9dd7998dfea94c4542f28ab305bdbe3b3f5abf83e5642fa394c02a
@@ -293,7 +293,15 @@ module CFA
293
293
  # @param located_entry [LocatedEntry] entry to insert
294
294
  # @return [String] where value should be written.
295
295
  def insert_after(preceding, located_entry)
296
- aug.insert(preceding.path, located_entry.key, false)
296
+ res = aug.insert(preceding.path, located_entry.key, false)
297
+ # if insert failed it means, that previous preceding entry was single
298
+ # element and now it is multiple ones, so try to first element as add
299
+ # is done in reverse order
300
+ if res == -1
301
+ # TODO: what about deep nesting of trees where upper level change
302
+ # from single to collection?
303
+ aug.insert(preceding.path + "[1]", located_entry.key, false)
304
+ end
297
305
  path_after(preceding)
298
306
  end
299
307
 
@@ -109,7 +109,7 @@ module CFA
109
109
  tree_value_plain(generic_get(key))
110
110
  end
111
111
 
112
- define_method(:"#{method_name.to_s}=") do |value|
112
+ define_method(:"#{method_name}=") do |value|
113
113
  tree_value_change(key, value)
114
114
  end
115
115
  end
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: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Reidinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-17 00:00:00.000000000 Z
11
+ date: 2019-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-augeas
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  version: 1.3.6
62
62
  requirements: []
63
63
  rubyforge_project:
64
- rubygems_version: 2.7.3
64
+ rubygems_version: 2.7.6.2
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: CFA (Config Files API) provides an easy way to create models on top of configuration