roundtrip_xml 1.1.3 → 1.1.4

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
  SHA1:
3
- metadata.gz: 501b785e89dfcf811395dd9862d4769b56146f97
4
- data.tar.gz: 33373f654acacbebee63fb89ed52339852044fb0
3
+ metadata.gz: f9ea3907395082b36dd7afbf113a44f6d299a90a
4
+ data.tar.gz: d3f75c78a60b4cc3b8267cc04e2b9bed00cfdb18
5
5
  SHA512:
6
- metadata.gz: 8d0363afac7100aaa3e30d0cf40e145efcf08db17d797607e12a7ebc660b98ef8a9b0bb9369cf7410cc8392fcf6d543e399abf8fae7b2fe5372e3e8c0ea26c81
7
- data.tar.gz: 694a752c7b3b7f77246dc200337f7d661502af15f7a3d778e83853b9c85492affc96f72548aa119681c45acc65516a26a6bdac606a3dd2aab9855f1e2743b248
6
+ metadata.gz: 431571069c490b1da1a1b3e177346edc8105057a61d98cfc0c23fb4b754dbbd050794f07294294c20b05275c5f622e4c8e8efcfd489d310c7d1731315f46cc67
7
+ data.tar.gz: 45743edbd50188c1b91f09fd01e93c3c264909e9eb21b218ddb25a4368785abd537c86171ec7747906e22a942f5055fdbf047362ea5f2fa18a84ed564fcd721c
@@ -88,6 +88,7 @@ class Extractor
88
88
 
89
89
  def convert_roxml_obj (obj)
90
90
  name = obj.class.class_name
91
+ old_metadata = obj._metadata
91
92
  defs = @definitions[name]
92
93
 
93
94
  defs.each do |defin|
@@ -101,6 +102,7 @@ class Extractor
101
102
  end
102
103
  set_attributes new_obj, param_values
103
104
  # return convert_roxml_obj new_obj
105
+ add_old_metadata new_obj, old_metadata, defin._metadata
104
106
  obj = new_obj
105
107
  end
106
108
  end if defs
@@ -118,6 +120,18 @@ class Extractor
118
120
  obj
119
121
  end
120
122
 
123
+ def add_old_metadata(obj, old_metadata, current_metadata)
124
+ # only keep the keys that don't exist in the template's metadata (current)
125
+ # that metadata will be availabled when evaluate the roxml object
126
+ # obj._metadata = old_metadata.merge current_metadata
127
+ diff_keys = old_metadata.keys.inject([]) do |out, key|
128
+ out << key unless current_metadata.key? key
129
+ out
130
+ end
131
+ new_metadata = old_metadata.delete_if {|k, _| !diff_keys.include? k}
132
+ obj._metadata = new_metadata
133
+ end
134
+
121
135
  def interpolated_diff(diff)
122
136
  diff.obj_val.is_a?(String) && diff.template_val.is_a?(Utils::UndefinedParam) && diff.template_val.original && diff.template_val.original.match(/#{Utils::UNDEFINED_PARAM}:/)
123
137
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roundtrip_xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Usick