foundry 0.6.1 → 0.6.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: 32c2e6183d6b17e9968202223f0c6ced2fb3519eefe3fbac7f345bc2dacb59f1
4
- data.tar.gz: 78db0b54f78f4ba2e8c851c5f8bcb2079b11e38b2e43f1f2a1899a0bf8453739
3
+ metadata.gz: 0ca6092b68a8605fd24bfb04d857ae2d0253213bca1a4c2562ca9b41f22e15ef
4
+ data.tar.gz: d720a500cc14c347f4ff71a3a51fccdffbd619df4d0654052e6b24a9ef565906
5
5
  SHA512:
6
- metadata.gz: 65210d7d6ce90722a51561460ee375de0d4e4b08443aaa3d4e87584b6067bd5631cf549f214922fe48988b699b364faababcb2b0328a7ea40d3803d744e78443
7
- data.tar.gz: c33f6c2ea16c068065fc25ed0aed92bfc402eff7ea882946be5d29b91b6d407ce5ddc1d06b98f26ce1686ac5a1bb8d16ceada1939a8ce5273503e28e6afd2f63
6
+ metadata.gz: 21f6b0e03b381751975bdc82edd6b18e01f66dd0d59ff2a4111e02ad2c8a166f017956737a85b53a6f07a66c442a05e1c0702ad47898b96a28bbe2bd1389b69a
7
+ data.tar.gz: ef1ec4256f0d53545a977a5a97abb632182b1475e983efb6c98078cf1087cea73faa54fdd605f8281dbae47884a8d92429d2551074def16fee9916116eef19cc
data/README.md CHANGED
@@ -117,6 +117,10 @@ Inheritance support:
117
117
  #
118
118
  # <config inherit="file1.xml"><value2>value</value2></config>
119
119
  #
120
+ # === file2.json.alt (functionally equivalent to the file above) ===
121
+ #
122
+ # <config><value2>value</value2><inherit>file1.xml</inherit></config>
123
+ #
120
124
  # When using the YAML parser, the file contents would be as follows:
121
125
  #
122
126
  # === file1.yml ===
data/TODO CHANGED
@@ -1 +1 @@
1
- 63b761d7-11d7-11e8-9f1a-8c85909b0be6 00000000-0000-0000-0000-000000000000 jzaleski jzaleski 1518647742 1518647742 a Add support for additional source-file types (e.g XML)
1
+ 63b761d7-11d7-11e8-9f1a-8c85909b0be6 00000000-0000-0000-0000-000000000000 jzaleski jzaleski 1518647742 1518657310 d Add support for additional source-file types (e.g XML)
@@ -11,6 +11,7 @@ if defined?(REXML::Document)
11
11
  result = {}
12
12
  root_node.children.each { |node| result[node.name] = node.text }
13
13
  inherit = root_node.attributes['inherit']
14
+ raise KeyError unless result['inherit'].nil? || inherit.nil?
14
15
  result['inherit'] = inherit unless inherit.nil?
15
16
  result
16
17
  end
@@ -1,3 +1,3 @@
1
1
  module Foundry
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
@@ -6,6 +6,11 @@ describe Foundry::Parsers::XML do
6
6
  eq({ 'foo' => 'bar' })
7
7
  end
8
8
 
9
+ it 'will raise an error if the XML inheritance value is ambiguous' do
10
+ expect { subject.parse('<config inherit="biz"><foo>bar</foo><inherit>baz</inherit></config>') }.to \
11
+ raise_error KeyError
12
+ end
13
+
9
14
  it 'will raise an error if the XML is not in the correct format' do
10
15
  expect { subject.parse('<foo>bar</foo>') }.to raise_error ArgumentError
11
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foundry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan W. Zaleski