hocon 1.1.2 → 1.1.3
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 +4 -4
- data/README.md +1 -7
- data/lib/hocon.rb +7 -3
- data/spec/fixtures/hocon/with_substitution/subst.conf +2 -0
- data/spec/unit/hocon/hocon_spec.rb +11 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 638d35f7a8e826220dcb4375b9f26bff467b317e
|
4
|
+
data.tar.gz: 3770d5073fc07bdfa4601950cb873f69c6642591
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5de129112ffe9e9fc0970d1075df7f0ab5581984a96bb91e84f95ba41aa70babc8351556dab354ec406c25e8accaec0725b6358799293bfbe72913941d1858ee
|
7
|
+
data.tar.gz: 291f399b5bf93cdd6c4fedd597f0720956ee58baf26e7c1ab0d31a5677f5100b4d2371fe088dc5773b1864a54f2147f658f34720814dd15c8d9e1365d1e522f3
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
[](https://travis-ci.org/puppetlabs/ruby-hocon)
|
2
|
-
|
3
1
|
ruby-hocon
|
4
2
|
==========
|
3
|
+
[](https://badge.fury.io/rb/hocon) [](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
|
data/lib/hocon.rb
CHANGED
@@ -33,15 +33,19 @@ module Hocon
|
|
33
33
|
resolved_config = Hocon::ConfigFactory.load_from_config(
|
34
34
|
config, Hocon::ConfigResolveOptions.defaults)
|
35
35
|
|
36
|
-
|
36
|
+
resolved_config.root.unwrapped
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.parse(string)
|
40
|
-
# doing
|
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
|
-
|
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
|
@@ -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.
|
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-
|
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.
|
207
|
+
rubygems_version: 2.2.5
|
207
208
|
signing_key:
|
208
209
|
specification_version: 4
|
209
210
|
summary: HOCON Config Library
|