iniparse 1.3.2 → 1.3.3

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: a760f778637f95470f11c04adaa34df3aac8052f
4
- data.tar.gz: 287f0dd450e28ed5a71ca780edd5e1b75ced7e32
3
+ metadata.gz: 495078e17e0358686da8bc6e375483281140bc39
4
+ data.tar.gz: fdee56564996ea5af6d7ba0dd51cf7952135264f
5
5
  SHA512:
6
- metadata.gz: ce1e0abf2a913b06d1d2251dc46b8187ac94e4da048deb1f81060c22e7b01b1415b15172435e58dae5bd0d84a41371e11ca73d165a9ab53754e9f89735474020
7
- data.tar.gz: 622d4222238d0918c47c40f683df31e9bc3bd10751198e7da429a23feef7f4d2ad38ca12811a6d431b948a8aa5973172b86f0f2338a410f5775f95b40f6376db
6
+ metadata.gz: 15751da5f0bea27de9b682a25602c21036136d6b87abf2b3786f4cbd1076d146943ac000214f61986449b48ec0ac6842f3e24b7d40137f9a5855f91b16181df3
7
+ data.tar.gz: 087fe62daf3a872cf7f13edccdab3a72743a1c2a1474c7137f2dc927e0496ff10548b5453e47571c0e2d18bcebe4210e58eed82f9c0ec7833d668ddb44b92c08
data/README.rdoc CHANGED
@@ -4,14 +4,6 @@ IniParse is a pure Ruby library for parsing
4
4
  INI[http://en.wikipedia.org/wiki/INI_file] configuration and data
5
5
  files.
6
6
 
7
- This rubygem is in ongoing development and - specs aside - hasn't yet been
8
- properly tested in a production environment. If you think you've found a bug,
9
- or you feed it an INI file which doesn't work as you'd expected, please mail
10
- me at +anthony at ninecraft dot com+, ideally with a copy of the INI file in
11
- question.
12
-
13
- IniParse tests pass on Ruby 1.8.6p399, 1.8.7p249, and 1.9.1p378, JRuby 1.4.0 and Rubinius 1.0.0 RC2.
14
-
15
7
  === Main features
16
8
 
17
9
  * <b>Support for duplicate options.</b> While not common, some INI files
data/Rakefile CHANGED
@@ -51,7 +51,7 @@ task :release => :build do
51
51
  puts "You must be on the master branch to release!"
52
52
  exit!
53
53
  end
54
- sh "git commit --allow-empty -a -m 'Release #{version}'"
54
+ # sh "git commit --allow-empty -a -m 'Release #{version}'"
55
55
  sh "git tag v#{version}"
56
56
  sh "git push origin master"
57
57
  sh "git push origin v#{version}"
data/iniparse.gemspec CHANGED
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
12
12
  ## If your rubyforge_project name is different, then edit it and comment out
13
13
  ## the sub! line in the Rakefile
14
14
  s.name = 'iniparse'
15
- s.version = '1.3.2'
16
- s.date = '2014-04-10'
15
+ s.version = '1.3.3'
16
+ s.date = '2014-10-30'
17
17
  s.rubyforge_project = 'iniparse'
18
18
 
19
19
  s.summary = 'A pure Ruby library for parsing INI documents.'
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
29
29
  s.require_paths = %w(lib)
30
30
 
31
31
  s.rdoc_options = ['--charset=UTF-8']
32
- s.extra_rdoc_files = %w(History LICENSE README.rdoc)
32
+ s.extra_rdoc_files = %w(LICENSE README.rdoc)
33
33
 
34
34
  # Dependencies.
35
35
  s.add_development_dependency('rspec', '~> 2.14')
@@ -37,7 +37,6 @@ Gem::Specification.new do |s|
37
37
  # = MANIFEST =
38
38
  s.files = %w[
39
39
  Gemfile
40
- History
41
40
  LICENSE
42
41
  README.rdoc
43
42
  Rakefile
data/lib/iniparse.rb CHANGED
@@ -7,7 +7,7 @@ require File.join(dir, 'lines')
7
7
  require File.join(dir, 'parser')
8
8
 
9
9
  module IniParse
10
- VERSION = '1.3.2'
10
+ VERSION = '1.3.3'
11
11
 
12
12
  # A base class for IniParse errors.
13
13
  class IniParseError < StandardError; end
@@ -110,8 +110,13 @@ module IniParse
110
110
  raise LineNotAllowed, "You can't nest sections in INI files."
111
111
  end
112
112
 
113
- @context = Lines::Section.new(name, line_options(opts))
114
- @document.lines << @context
113
+ # Add to a section if it already exists
114
+ if @document.has_section?(name.to_s())
115
+ @context = @document[name.to_s()]
116
+ else
117
+ @context = Lines::Section.new(name, line_options(opts))
118
+ @document.lines << @context
119
+ end
115
120
 
116
121
  if block_given?
117
122
  begin
@@ -261,8 +261,8 @@ module IniParse
261
261
  when /^\s*$/ then nil
262
262
  when /^-?(?:\d|[1-9]\d+)$/ then Integer(value)
263
263
  when /^-?(?:\d|[1-9]\d+)(?:\.\d+)?(?:e[+-]?\d+)?$/i then Float(value)
264
- when /true/i then true
265
- when /false/i then false
264
+ when /^true$/i then true
265
+ when /^false$/i then false
266
266
  else value
267
267
  end
268
268
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iniparse
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-10 00:00:00.000000000 Z
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -30,12 +30,10 @@ email: hi@antw.me
30
30
  executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files:
33
- - History
34
33
  - LICENSE
35
34
  - README.rdoc
36
35
  files:
37
36
  - Gemfile
38
- - History
39
37
  - LICENSE
40
38
  - README.rdoc
41
39
  - Rakefile
data/History DELETED
@@ -1,16 +0,0 @@
1
- == 1.1.5 (21st December 2011)
2
-
3
- * An equals "=" is now permitted in section names.
4
-
5
- == 1.1.4 (2nd September 2010)
6
-
7
- * Fix parsing of lines which contains an equals in the value.
8
-
9
- == 1.1.3 (4th March 2010)
10
-
11
- * Fix so that VERSION is correctly read on Windows.
12
-
13
- == 1.1.0, 1.1.1, 1.1.2 (23rd February 2010)
14
-
15
- * Removed extlib dependency
16
- * Added this file. :)