inifile 2.0.1 → 2.0.2
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.
- data/.travis.yml +1 -1
- data/History.txt +5 -0
- data/lib/inifile.rb +2 -2
- data/test/test_inifile.rb +7 -0
- metadata +2 -2
data/.travis.yml
CHANGED
data/History.txt
CHANGED
data/lib/inifile.rb
CHANGED
@@ -8,7 +8,7 @@ class IniFile
|
|
8
8
|
include Enumerable
|
9
9
|
|
10
10
|
class Error < StandardError; end
|
11
|
-
VERSION = '2.0.
|
11
|
+
VERSION = '2.0.2'
|
12
12
|
|
13
13
|
# Public: Open an INI file and load the contents.
|
14
14
|
#
|
@@ -449,7 +449,7 @@ private
|
|
449
449
|
# otherwise scan and store characters till we hit the start of some
|
450
450
|
# special section like a quote, newline, comment, etc.
|
451
451
|
else
|
452
|
-
tmp = scanner.scan_until(%r/([\n"#{@param}#{@comment}]
|
452
|
+
tmp = scanner.scan_until(%r/([\n"#{@param}#{@comment}] | \z | \\[\[\]#{@param}#{@comment}"])/mx)
|
453
453
|
parse_error if tmp.nil?
|
454
454
|
|
455
455
|
len = scanner[1].length
|
data/test/test_inifile.rb
CHANGED
@@ -252,6 +252,13 @@ class TestIniFile < Test::Unit::TestCase
|
|
252
252
|
assert_raise(IniFile::Error) {IniFile.new :filename => 'test/data/bad_1.ini'}
|
253
253
|
end
|
254
254
|
|
255
|
+
def test_initialize_from_string_without_ending_newline
|
256
|
+
content = "[section_one]\n foo=bar"
|
257
|
+
ini_file = IniFile.new(content)
|
258
|
+
assert ini_file.has_section?('section_one')
|
259
|
+
assert_equal 'bar', ini_file['section_one']['foo']
|
260
|
+
end
|
261
|
+
|
255
262
|
def test_initialize_from_string
|
256
263
|
content = File.read('test/data/good.ini')
|
257
264
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inifile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bones-git
|