tiller 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e62758150f605bde5fe1a7569a7c21863a20efa
4
- data.tar.gz: a4add2e1ddd2d052a2ba02e8439a28def3cf8243
3
+ metadata.gz: 23cb72e7fababe5a22673372565626bf2f12d7cc
4
+ data.tar.gz: 087415e292aabae4501b67597691731531b4e7c8
5
5
  SHA512:
6
- metadata.gz: c5de9d5c1cbc59a625a330b67661a1ce8d64724d603c10d883deaad2e44c587d0f178eb9a009da3f5e9fa0504dad05f18f46b8b718c2c72ee4309cd1259ac6b4
7
- data.tar.gz: ace0330ab12fce2633dad432124ba8750efd9081bb6ec9afb17e1d8b5d1e4057e61dd9d95bd7db9c4ced16a5042bdbbea4b4e84ed5e8909d15072c333e95f29f
6
+ metadata.gz: 03c72384821731e643492147b7e8cc6ac303b78a56dcfeff21aab927ad537936fac54cadfabf684b0ac7609f7ad4c0a129aa144a8467cb67ce6bdfdd6d76e635
7
+ data.tar.gz: 031b42444defb5241356e4a96d778d19b6858927dfbeaf9398bb6f69b481548b322c229af6131aad70556099b1e79c426fb6f4385b17d499e5b8e559c1c6b4cb
data/bin/tiller CHANGED
@@ -8,7 +8,7 @@
8
8
  #
9
9
  # Mark Dastmalchi-Round <github@markround.com>
10
10
 
11
- VERSION = '0.7.1'
11
+ VERSION = '0.7.2'
12
12
 
13
13
  require 'erb'
14
14
  require 'ostruct'
@@ -0,0 +1,35 @@
1
+ require 'crack'
2
+
3
+ # This datasource reads an XML file (xml_file_path), parses it using the crack gem and then
4
+ # Makes it available to templates as a named structure (xml_file_var).
5
+
6
+ class XmlFileDataSource < Tiller::DataSource
7
+
8
+ def global_values
9
+ parse_xml(@config)
10
+ end
11
+
12
+ def values(template)
13
+ parse_xml(@config['environments'][@config[:environment]][template])
14
+ end
15
+
16
+ def parse_xml(config_hash)
17
+ if config_hash.has_key?('xml_file_path') && config_hash.has_key?('xml_file_var')
18
+ path = config_hash['xml_file_path']
19
+ var = config_hash['xml_file_var']
20
+ @log.info('Opening XML file : ' + path)
21
+ begin
22
+ xml = Crack::XML.parse(File.open(path))
23
+ rescue Exception => e
24
+ abort "Error : Could not parse XML file #{path}\n#{e}"
25
+ end
26
+ struct = {}
27
+ struct[var] = xml
28
+ @log.debug("Created XML structure : #{struct}")
29
+ struct
30
+ else
31
+ {}
32
+ end
33
+ end
34
+
35
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Dastmalchi-Round
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-07 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A tool to create configuration files from a variety of sources, particularly
14
14
  useful for Docker containers. See https://github.com/markround/tiller for examples
@@ -57,6 +57,7 @@ files:
57
57
  - lib/tiller/data/file.rb
58
58
  - lib/tiller/data/http.rb
59
59
  - lib/tiller/data/random.rb
60
+ - lib/tiller/data/xml_file.rb
60
61
  - lib/tiller/data/zookeeper.rb
61
62
  - lib/tiller/datasource.rb
62
63
  - lib/tiller/defaults.rb