java-properties 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d4f07c15c1f58cb3478fab7debf52316d9649cc3
4
- data.tar.gz: 7b340371a2ea3b0420fb2e0ee532e926fd8bc006
2
+ SHA256:
3
+ metadata.gz: 47e9944f60bded6fe4278a5e6c2b8134178ea07c1b747288cdeb2073a48059f2
4
+ data.tar.gz: d42b2236eed0ac3133c5a58568d03d187463edaf98ccbe2b5369b999e3fa6d5b
5
5
  SHA512:
6
- metadata.gz: c9c763b44183f8e3175326d1d699af24386cdc6abe95b6de3df9fa5514ed6ade61470be36a84403e032238403ac8eca5bf1dd036d5fb59e4db5ed6b7b8581491
7
- data.tar.gz: 08865b814f74ab2fb98381843a0550b25b107a825ecc985813db0580c2f24d3aefab9f1914b50b787c05819d1a3c242bb595d5bb1e787e5d7d412b75cb487492
6
+ metadata.gz: be10a0714bb4ccf1650dba89e00a8520388df30c52785e14af7cd776b4b897810b1522c3e0456a2f1073e65c2cf6014e336e4cbbdd5db72cc0ce3d92eaea4021
7
+ data.tar.gz: 376513a3679a9d299612442d19613e3a8f809af41d9f899402d8bdff513d567d66c688e5f9170fbc3dcc0aef7e1f8c1769bd8012e754b7c65f0754091ab07abf
data/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  # JavaProperties
2
2
 
3
- [![Build Status](http://img.shields.io/travis/jnbt/java-properties.svg)](https://travis-ci.org/jnbt/java-properties)
4
- [![Code Climate](http://img.shields.io/codeclimate/github/jnbt/java-properties.svg)](https://codeclimate.com/github/jnbt/java-properties)
5
- [![Coveralls](http://img.shields.io/coveralls/jnbt/java-properties.svg)](https://coveralls.io/r/jnbt/java-properties)
6
- [![RubyGems](http://img.shields.io/gem/v/java-properties.svg)](http://rubygems.org/gems/java-properties)
7
- [![Gemnasium](http://img.shields.io/gemnasium/jnbt/java-properties.svg)](https://gemnasium.com/jnbt/java-properties)
3
+ [![Build Status](http://img.shields.io/travis/jnbt/java-properties)](https://travis-ci.org/jnbt/java-properties)
4
+ [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/jnbt/java-properties)](https://codeclimate.com/github/jnbt/java-properties)
5
+ [![Coveralls](http://img.shields.io/coveralls/jnbt/java-properties)](https://coveralls.io/r/jnbt/java-properties)
6
+ [![RubyGems](http://img.shields.io/gem/v/java-properties)](http://rubygems.org/gems/java-properties)
8
7
  [![Inline docs](http://inch-ci.org/github/jnbt/java-properties.svg?style=shields)](http://inch-ci.org/github/jnbt/java-properties)
9
8
 
10
9
  A ruby library to read and write [Java properties files](http://en.wikipedia.org/wiki/.properties).
@@ -35,7 +34,7 @@ properties[:foo] # => "bar"
35
34
  If have already the content of the properties file at hand than parse the content as:
36
35
 
37
36
  ```ruby
38
- properties = JavaProperties.load("foo=bar")
37
+ properties = JavaProperties.parse("foo=bar")
39
38
  properties[:foo] # => "bar"
40
39
  ```
41
40
 
@@ -67,13 +66,13 @@ As Java properties files normally hold UTF-8 chars in their escaped representati
67
66
  The tool also escaped every '=', ' ' and ':' in the name part of a property line:
68
67
 
69
68
  ```ruby
70
- JavaProperties.generate({"i : like=strange" => "bar"})
69
+ JavaProperties.generate({"i : like=strange" => "bar"})
71
70
  # => "i\ \:\ like\=strange=bar"
72
71
  ```
73
72
 
74
73
  ## Multi line and line breaks
75
74
 
76
- In Java properties files a string can be multi line but line breaks have to be escaped.
75
+ In Java properties files a string can be multi line but line breaks have to be escaped.
77
76
 
78
77
  Assume the following input:
79
78
 
@@ -1,24 +1,28 @@
1
1
  # coding: utf-8
2
- # coding: utf-8
3
2
  lib = File.expand_path('../lib', __FILE__)
4
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
4
  require 'java-properties/version'
6
5
 
7
6
  Gem::Specification.new do |spec|
8
- spec.name = "java-properties"
7
+ spec.name = 'java-properties'
9
8
  spec.version = JavaProperties::VERSION.dup
10
- spec.authors = ["Jonas Thiel"]
11
- spec.email = ["jonas@thiel.io"]
9
+ spec.authors = ['Jonas Thiel']
10
+ spec.email = ['jonas@thiel.io']
12
11
  spec.summary = %q{Loader and writer for *.properties files}
13
12
  spec.description = %q{Tool for loading and writing Java properties files}
14
- spec.homepage = "https://github.com/jnbt/java-properties"
15
- spec.license = "MIT"
13
+ spec.homepage = 'https://github.com/jnbt/java-properties'
14
+ spec.license = 'MIT'
16
15
 
17
16
  spec.files = %w(LICENSE README.md Rakefile java-properties.gemspec)
18
- spec.files += Dir.glob("lib/**/*.rb")
19
- spec.test_files = Dir.glob("spec/**/*.rb")
20
- spec.test_files = Dir.glob("spec/fixtures/**/*.properties")
17
+ spec.files += Dir.glob('lib/**/*.rb')
18
+ spec.test_files = Dir.glob('spec/**/*.rb')
19
+ spec.test_files = Dir.glob('spec/fixtures/**/*.properties')
21
20
 
22
21
  spec.required_rubygems_version = '>= 1.3.5'
23
22
  spec.required_ruby_version = '~> 2.0'
23
+
24
+ spec.add_development_dependency 'rake', '~> 13.0'
25
+ spec.add_development_dependency 'inch', '~> 0.8'
26
+ spec.add_development_dependency 'minitest', '~> 5.14'
27
+ spec.add_development_dependency 'coveralls', '~> 0.8'
24
28
  end
@@ -10,7 +10,8 @@ module JavaProperties
10
10
  "\t" => '\\t',
11
11
  "\r" => '\\r',
12
12
  "\n" => '\\n',
13
- "\f" => '\\f'
13
+ "\f" => '\\f',
14
+ "\\" => '\\\\',
14
15
  }.freeze
15
16
 
16
17
  # Lookup table to remove escaping from special chars
@@ -45,4 +46,4 @@ module JavaProperties
45
46
 
46
47
  end
47
48
  end
48
- end
49
+ end
@@ -2,6 +2,6 @@ module JavaProperties
2
2
 
3
3
  # Current version
4
4
  # @return [String]
5
- VERSION = "0.2.0".freeze
5
+ VERSION = "0.2.1".freeze
6
6
 
7
7
  end
@@ -32,3 +32,7 @@ item10=test\n\ttest\u0050 \
32
32
  test\n\ttest = test
33
33
 
34
34
  item11=a\u00e4b \ud868\udc2f
35
+
36
+ item12=#no comment
37
+
38
+ item13=with\\back\\nslash\\t
@@ -10,3 +10,5 @@ item8=line 1 line 2 line 3
10
10
  item9=line 1 line 2 line 3
11
11
  item10=test\n\ttest\u0050 test\n\ttest test\n\ttest = test
12
12
  item11=a\u00e4b \ud868\udc2f
13
+ item12=#no comment
14
+ item13=with\\back\\nslash\\t
metadata CHANGED
@@ -1,15 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: java-properties
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Thiel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-28 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2020-05-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '13.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '13.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: inch
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.8'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.8'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.14'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.14'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.8'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.8'
13
69
  description: Tool for loading and writing Java properties files
14
70
  email:
15
71
  - jonas@thiel.io
@@ -59,17 +115,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
115
  - !ruby/object:Gem::Version
60
116
  version: 1.3.5
61
117
  requirements: []
62
- rubyforge_project:
63
- rubygems_version: 2.5.1
118
+ rubygems_version: 3.1.2
64
119
  signing_key:
65
120
  specification_version: 4
66
121
  summary: Loader and writer for *.properties files
67
122
  test_files:
68
123
  - spec/fixtures/bom.properties
69
- - spec/fixtures/test.properties
70
- - spec/fixtures/test_normalized.properties
71
- - spec/fixtures/test_out.properties
72
124
  - spec/fixtures/test_out_skip_separators.properties
125
+ - spec/fixtures/test_normalized.properties
73
126
  - spec/fixtures/test_out_skip_special_chars.properties
127
+ - spec/fixtures/test_out.properties
128
+ - spec/fixtures/test.properties
74
129
  - spec/fixtures/test_out_skip_unicode.properties
75
- has_rdoc: