hocon 1.1.2 → 1.1.3

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: 313f7a6dd2e038b4a470e80d8342bc3e7607ed0c
4
- data.tar.gz: 945e4bbde03daafdb38cb99e412e7ce448ff7c81
3
+ metadata.gz: 638d35f7a8e826220dcb4375b9f26bff467b317e
4
+ data.tar.gz: 3770d5073fc07bdfa4601950cb873f69c6642591
5
5
  SHA512:
6
- metadata.gz: 151f0721cb1d6a82951eb6811f4d841d64070a51073b4836c6f0e7ef7629444049f2d53a9286a4d29c6ee5f514d02285e7322c972ac1fd7275f7752a59c41bb1
7
- data.tar.gz: 55c1486bccf6850ef061101d89c57df90757650b222d8f1824b013c589156b1ac644514cc39b280eba943c302402f477c8f429714b3fdd89ab0b540f80951bcc
6
+ metadata.gz: 5de129112ffe9e9fc0970d1075df7f0ab5581984a96bb91e84f95ba41aa70babc8351556dab354ec406c25e8accaec0725b6358799293bfbe72913941d1858ee
7
+ data.tar.gz: 291f399b5bf93cdd6c4fedd597f0720956ee58baf26e7c1ab0d31a5677f5100b4d2371fe088dc5773b1864a54f2147f658f34720814dd15c8d9e1365d1e522f3
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
- [![Build Status](https://travis-ci.org/puppetlabs/ruby-hocon.png?branch=master)](https://travis-ci.org/puppetlabs/ruby-hocon)
2
-
3
1
  ruby-hocon
4
2
  ==========
3
+ [![Gem Version](https://badge.fury.io/rb/hocon.svg)](https://badge.fury.io/rb/hocon) [![Build Status](https://travis-ci.org/puppetlabs/ruby-hocon.png?branch=master)](https://travis-ci.org/puppetlabs/ruby-hocon)
5
4
 
6
5
  This is a port of the [Typesafe Config](https://github.com/typesafehub/config) library to Ruby.
7
6
 
@@ -94,8 +93,3 @@ Unsupported features include:
94
93
  * Duration and size settings
95
94
  * Java system properties
96
95
 
97
- ## Maintainence
98
-
99
- Maintainers: Joe Pinsonault <joe.pinsonault@puppet.com>, Chris Price <chris@puppet.com>, Kevin Corcoran <kevin.corcoran@puppet.com>
100
-
101
- Tickets: https://tickets.puppetlabs.com/browse/HC
@@ -33,15 +33,19 @@ module Hocon
33
33
  resolved_config = Hocon::ConfigFactory.load_from_config(
34
34
  config, Hocon::ConfigResolveOptions.defaults)
35
35
 
36
- return resolved_config.root.unwrapped
36
+ resolved_config.root.unwrapped
37
37
  end
38
38
 
39
39
  def self.parse(string)
40
- # doing this require lazily, because otherwise, classes that need to
40
+ # doing these requires lazily, because otherwise, classes that need to
41
41
  # `require 'hocon'` to get the module into scope will end up recursing
42
42
  # through this require and probably ending up with circular dependencies.
43
43
  require 'hocon/config_factory'
44
+ require 'hocon/config_resolve_options'
44
45
  config = Hocon::ConfigFactory.parse_string(string)
45
- return config.root.unwrapped
46
+ resolved_config = Hocon::ConfigFactory.load_from_config(
47
+ config, Hocon::ConfigResolveOptions.defaults)
48
+
49
+ resolved_config.root.unwrapped
46
50
  end
47
51
  end
@@ -0,0 +1,2 @@
1
+ a: true
2
+ b: ${a}
@@ -98,6 +98,17 @@ describe Hocon do
98
98
  end
99
99
  end
100
100
 
101
+ context "loading config that includes substitutions" do
102
+ it "should be able to `load` from a file" do
103
+ expect(Hocon.load("#{FIXTURE_DIR}/hocon/with_substitution/subst.conf")).
104
+ to eq({"a" => true, "b" => true})
105
+ end
106
+ it "should be able to `parse` from a string" do
107
+ expect(Hocon.parse(File.read("#{FIXTURE_DIR}/hocon/with_substitution/subst.conf"))).
108
+ to eq({"a" => true, "b" => true})
109
+ end
110
+ end
111
+
101
112
 
102
113
  end
103
114
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hocon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Price
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2016-07-15 00:00:00.000000000 Z
16
+ date: 2016-10-12 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: bundler
@@ -142,6 +142,7 @@ files:
142
142
  - spec/fixtures/hocon/by_extension/cat.conf
143
143
  - spec/fixtures/hocon/by_extension/cat.test
144
144
  - spec/fixtures/hocon/by_extension/cat.test-json
145
+ - spec/fixtures/hocon/with_substitution/subst.conf
145
146
  - spec/fixtures/parse_render/example1/input.conf
146
147
  - spec/fixtures/parse_render/example1/output.conf
147
148
  - spec/fixtures/parse_render/example1/output_nocomments.conf
@@ -203,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
204
  version: '0'
204
205
  requirements: []
205
206
  rubyforge_project:
206
- rubygems_version: 2.4.5.1
207
+ rubygems_version: 2.2.5
207
208
  signing_key:
208
209
  specification_version: 4
209
210
  summary: HOCON Config Library