hocon 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/hocon/impl/parseable.rb +2 -2
- data/spec/fixtures/test_utils/resources/utf16.conf +0 -0
- data/spec/fixtures/test_utils/resources/utf8.conf +2 -0
- data/spec/fixtures/test_utils/resources//341/232/240/341/233/207/341/232/273.conf +2 -0
- data/spec/unit/typesafe/config/conf_parser_spec.rb +20 -10
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 313f7a6dd2e038b4a470e80d8342bc3e7607ed0c
|
4
|
+
data.tar.gz: 945e4bbde03daafdb38cb99e412e7ce448ff7c81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 151f0721cb1d6a82951eb6811f4d841d64070a51073b4836c6f0e7ef7629444049f2d53a9286a4d29c6ee5f514d02285e7322c972ac1fd7275f7752a59c41bb1
|
7
|
+
data.tar.gz: 55c1486bccf6850ef061101d89c57df90757650b222d8f1824b013c589156b1ac644514cc39b280eba943c302402f477c8f429714b3fdd89ab0b540f80951bcc
|
data/CHANGELOG.md
CHANGED
data/lib/hocon/impl/parseable.rb
CHANGED
@@ -412,11 +412,11 @@ class Hocon::Impl::Parseable
|
|
412
412
|
def open
|
413
413
|
begin
|
414
414
|
if block_given?
|
415
|
-
File.open(@input) do |f|
|
415
|
+
File.open(@input, :encoding => 'bom|utf-8') do |f|
|
416
416
|
yield f
|
417
417
|
end
|
418
418
|
else
|
419
|
-
File.open(@input)
|
419
|
+
File.open(@input, :encoding => 'bom|utf-8')
|
420
420
|
end
|
421
421
|
rescue Errno::ENOENT
|
422
422
|
if @initial_options.allow_missing?
|
Binary file
|
@@ -781,22 +781,32 @@ describe "Config Parser" do
|
|
781
781
|
# Skipping 'includeURLHeuristically' because we don't support URLs
|
782
782
|
# Skipping 'includeURLBasenameHeuristically' because we don't support URLs
|
783
783
|
|
784
|
-
it "
|
785
|
-
skip(
|
786
|
-
|
787
|
-
conf = Hocon::ConfigFactory.parse_file(TestUtils.resource_file("bom.conf"))
|
788
|
-
expect(conf.get_string("foo")).to eq("bar")
|
784
|
+
it "shouldacceptUTF8FileNames" do
|
785
|
+
skip('UTF-8 filenames not currently supported') do
|
786
|
+
expect { Hocon::ConfigFactory.parse_file(TestUtils.resource_file("ᚠᛇᚻ.conf")) }.to raise_error
|
789
787
|
end
|
790
788
|
end
|
791
789
|
|
792
|
-
it "
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
790
|
+
it "acceptsUTF8FileContents" do
|
791
|
+
# utf8.conf is UTF-8 with no BOM
|
792
|
+
rune_utf8 = "\u16EB\u16D2\u16E6\u16A6\u16EB\u16A0\u16B1\u16A9\u16A0\u16A2"
|
793
|
+
conf = Hocon::ConfigFactory.parse_file(TestUtils.resource_file("utf8.conf"))
|
794
|
+
expect(conf.get_string("\u16A0\u16C7\u16BB")).to eq(rune_utf8)
|
795
|
+
end
|
796
|
+
|
797
|
+
it "shouldacceptUTF16FileContents" do
|
798
|
+
skip('supporting UTF-16 requires appropriate BOM detection during parsing') do
|
799
|
+
# utf16.conf is UTF-16LE with a BOM
|
800
|
+
expect { Hocon::ConfigFactory.parse_file(TestUtils.resource_file("utf16.conf")) }.to raise_error
|
797
801
|
end
|
798
802
|
end
|
799
803
|
|
804
|
+
it "acceptBOMStartingFile" do
|
805
|
+
# BOM at start of file should be ignored
|
806
|
+
conf = Hocon::ConfigFactory.parse_file(TestUtils.resource_file("bom.conf"))
|
807
|
+
expect(conf.get_string("foo")).to eq("bar")
|
808
|
+
end
|
809
|
+
|
800
810
|
it "acceptBOMInStringValue" do
|
801
811
|
# BOM inside quotes should be preserved, just as other whitespace would be
|
802
812
|
conf = Hocon::ConfigFactory.parse_string("foo=\"\uFEFF\uFEFF\"")
|
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.2
|
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-
|
16
|
+
date: 2016-07-15 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: bundler
|
@@ -162,6 +162,9 @@ files:
|
|
162
162
|
- spec/fixtures/test_utils/resources/test01.conf
|
163
163
|
- spec/fixtures/test_utils/resources/test01.json
|
164
164
|
- spec/fixtures/test_utils/resources/test03.conf
|
165
|
+
- spec/fixtures/test_utils/resources/utf16.conf
|
166
|
+
- spec/fixtures/test_utils/resources/utf8.conf
|
167
|
+
- spec/fixtures/test_utils/resources/ᚠᛇᚻ.conf
|
165
168
|
- spec/spec_helper.rb
|
166
169
|
- spec/test_utils.rb
|
167
170
|
- spec/unit/hocon/README.md
|