hocon 0.1.0 → 0.9.0

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: 8d1d8c906c6a713c9f0e3c005449b4f27f43de4d
4
- data.tar.gz: 81828db454ff9ec38b722b3245309c42dfd521be
3
+ metadata.gz: 336e47bf6c04b6b8c7d9fe769cfb5a7d80227e5d
4
+ data.tar.gz: a74955786d95546de69fc8c5bb98634848387a74
5
5
  SHA512:
6
- metadata.gz: bceacdf280b8674be1d2c0019d365920cf7edffd303e76a19ba51eb2b77bbe4ac759f9b9675f650bb321be65b1be853d98da8bfd92880c90ec32c538a27443e7
7
- data.tar.gz: bd795df60b8d4297d96b79e4ba80db4cb1248828fb00db15fb3886a6f8e6a316fe6c49280cbf57436d29d9ce5a639435f3d18186571389343d73c19282f3f533
6
+ metadata.gz: 1ee3d3aaa08eaaf337fd8fd32ecc3b184401b0335a430b544d7ab1d7e691905526c4c727e56be82e0a70bb77556d6cf5effb12359e734e9d9ad796a22b50aaa4
7
+ data.tar.gz: b8fd8823f59d498714ba09a9f68fe1e069d2861cd393b08c5970b8c1630dc80b1ba5acd5de99a9dd4e6e09775c60ca1746f61139cfa4a03162f82ed8108b353c
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ ## 0.9.0
2
+
3
+ This is a promotion of the 0.1.0 release with one small bug fix:
4
+ * Fixed bug wherein using the `set_config_value` method with some parsed values would cause a failure due to surrounding whitespace
5
+
6
+ ## 0.1.0
7
+
8
+ This is a feature release containing a large number of changes and improvements
9
+
10
+ * Added support for concatenation
11
+ * Added support for substitutions
12
+ * Added support for file includes. Other types of includes are not supported
13
+ * Added the new ConfigDocument API that was recently implemented in the upstream Java library
14
+ * Improved JSON support
15
+ * Fixed a large number of small bugs related to various pieces of implementation
data/README.md CHANGED
@@ -7,8 +7,10 @@ This is a port of the [Typesafe Config](https://github.com/typesafehub/config) l
7
7
 
8
8
  The library provides Ruby support for the [HOCON](https://github.com/typesafehub/config/blob/master/HOCON.md) configuration file format.
9
9
 
10
- At present, the only features it supports are explicit parsing of config files (.conf/HOCON, .json) 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.
11
- PLEASE NOTE that as a result this project is in a very experimental state, and in some cases may not work properly, so
10
+
11
+ At present, it supports supports parsing and modification of existing HOCON/JSON files via the `ConfigFactory` class and the `ConfigValueFactory` class, and rendering parsed config objects back to a String.
12
+ It also supports the parsing and modification of HOCON/JSON files via `ConfigDocumentFactory`.
13
+ PLEASE NOTE this project is in an experimental state, and in some cases may not work properly, so
12
14
  please be wary when using it. If you find a problem, feel free to open a github issue.
13
15
 
14
16
  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.
@@ -28,6 +30,22 @@ conf = Hocon::ConfigFactory.parse_file("myapp.conf")
28
30
  conf_map = conf.root.unwrapped
29
31
  ```
30
32
 
33
+ To use the ConfigDocument API
34
+
35
+ ```rb
36
+ require 'hocon/parser/config_document_factory'
37
+ require 'hocon/config_value_factory'
38
+
39
+ # The below 4 variables will all be ConfigDocument instances
40
+ doc = Hocon::Parser::ConfigDocumentFactory.parse_file("myapp.conf")
41
+ doc2 = doc.set_value("a.b", "[1, 2, 3, 4, 5]")
42
+ doc3 = doc.remove_value("a")
43
+ doc4 = doc.set_config_value("a.b", Hocon::ConfigValueFactory.from_any_ref([1, 2, 3, 4, 5]))
44
+
45
+ doc_has_value = doc.has_value?("a") # returns boolean
46
+ orig_doc_text = doc.render # returns string
47
+ ```
48
+
31
49
  Testing
32
50
  =======
33
51
 
@@ -35,3 +53,15 @@ Testing
35
53
  bundle install
36
54
  bundle exec rspec spec
37
55
  ```
56
+
57
+ Unsupported Features
58
+ ====================
59
+
60
+ This supports many of the same things as the Java library, but there are some notable exceptions. Unsupported features include:
61
+
62
+ * Non file includes
63
+ * Loading resources from the class path or URLs
64
+ * Properties files
65
+ * Parsing anything other than files and strings
66
+ * Duration and size settings
67
+ * Java system properties
@@ -23,7 +23,7 @@ class Hocon::Impl::SimpleConfigDocument
23
23
  end
24
24
 
25
25
  def set_config_value(path, new_value)
26
- set_value(path, new_value.render)
26
+ set_value(path, new_value.render.strip)
27
27
  end
28
28
 
29
29
  def remove_value(path)
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: 0.1.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Price
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-04-09 00:00:00.000000000 Z
15
+ date: 2015-04-10 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
@@ -49,6 +49,7 @@ executables: []
49
49
  extensions: []
50
50
  extra_rdoc_files: []
51
51
  files:
52
+ - CHANGELOG.md
52
53
  - LICENSE
53
54
  - README.md
54
55
  - lib/hocon.rb
@@ -149,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
150
  requirements:
150
151
  - - ">="
151
152
  - !ruby/object:Gem::Version
152
- version: '0'
153
+ version: 1.9.0
153
154
  required_rubygems_version: !ruby/object:Gem::Requirement
154
155
  requirements:
155
156
  - - ">="