hocon 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -6,6 +6,8 @@ This is a port of the [Typesafe Config](https://github.com/typesafehub/config) l
6
6
  The library provides Ruby support for the [HOCON](https://github.com/typesafehub/config/blob/master/HOCON.md) configuration file format.
7
7
 
8
8
  At present, the only features it supports are explicit parsing of config files (.conf/HOCON, .json, .properties) via `ConfigFactory.parse_file`, and rendering a parsed config object back to a String. Testing is minimal and not all data types are supported yet. It also does not yet support `include` or interpolated settings.
9
+ PLEASE NOTE that as a result this project is in a very experimental state, and in some cases may not work properly, so
10
+ please be wary when using it. If you find a problem, feel free to open a github issue.
9
11
 
10
12
  The implementation is intended to be as close to a line-for-line port as the two languages allow, in hopes of making it fairly easy to port over new changesets from the Java code base over time.
11
13
 
@@ -12,6 +12,7 @@ require 'hocon/impl/simple_config_object'
12
12
  require 'hocon/impl/config_impl_util'
13
13
  require 'hocon/impl/tokenizer'
14
14
  require 'hocon/impl/simple_config_origin'
15
+ require 'hocon/impl/path'
15
16
 
16
17
  class Hocon::Impl::Parser
17
18
 
@@ -26,6 +27,7 @@ class Hocon::Impl::Parser
26
27
  ConfigImplUtil = Hocon::Impl::ConfigImplUtil
27
28
  PathBuilder = Hocon::Impl::PathBuilder
28
29
  Tokenizer = Hocon::Impl::Tokenizer
30
+ Path = Hocon::Impl::Path
29
31
 
30
32
  class TokenWithComments
31
33
  def initialize(token, comments = [])
@@ -479,7 +481,7 @@ class Hocon::Impl::Parser
479
481
  add_quote_suggestion(t, "Expecting close brace } or a comma, got #{t}",
480
482
  last_path, last_inside_equals))
481
483
  else
482
- if t.token == Tokens::END
484
+ if t.token == Tokens::EOF
483
485
  put_back(t)
484
486
  break
485
487
  else
@@ -568,7 +570,7 @@ class Hocon::Impl::Parser
568
570
  result = parse_value(t)
569
571
  else
570
572
  if @syntax == ConfigSyntax::JSON
571
- if t.token == Tokens::END
573
+ if t.token == Tokens::EOF
572
574
  raise parse_error("Empty document")
573
575
  else
574
576
  raise parse_error("Document must have an object or array at root, unexpected token: #{t}")
@@ -131,6 +131,10 @@ class Hocon::Impl::Path
131
131
  pb.result
132
132
  end
133
133
 
134
+ def self.new_key(key)
135
+ return self.new(key, nil)
136
+ end
137
+
134
138
  def self.new_path(path)
135
139
  Hocon::Impl::Parser.parse_path(path)
136
140
  end
metadata CHANGED
@@ -1,18 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hocon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chris Price
9
9
  - Wayne Warren
10
- - Dai Akatsuka
11
10
  - Preben Ingvaldsen
12
11
  autorequire:
13
12
  bindir: bin
14
13
  cert_chain: []
15
- date: 2014-10-14 00:00:00.000000000 Z
14
+ date: 2015-01-20 00:00:00.000000000 Z
16
15
  dependencies:
17
16
  - !ruby/object:Gem::Dependency
18
17
  name: bundler