iniparse 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/History CHANGED
@@ -1,6 +1,10 @@
1
+ == 1.1.5 (21st December 2011)
2
+
3
+ * An equals "=" is now permitted in section names.
4
+
1
5
  == 1.1.4 (2nd September 2010)
2
6
 
3
- * Fix parsing of lines which contains an equals in the value
7
+ * Fix parsing of lines which contains an equals in the value.
4
8
 
5
9
  == 1.1.3 (4th March 2010)
6
10
 
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'rake'
3
3
  require 'date'
4
4
 
5
5
  require 'rake/clean'
6
- require 'rake/rdoctask'
6
+ require 'rdoc/task'
7
7
  require 'rspec/core/rake_task'
8
8
 
9
9
  ##############################################################################
@@ -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.1.4'
16
- s.date = '2010-09-02'
15
+ s.version = '1.1.5'
16
+ s.date = '2011-12-21'
17
17
  s.rubyforge_project = 'iniparse'
18
18
 
19
19
  s.summary = 'A pure Ruby library for parsing INI documents.'
@@ -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.1.4'
10
+ VERSION = '1.1.5'
11
11
 
12
12
  # A base class for IniParse errors.
13
13
  class IniParseError < StandardError; end
@@ -20,8 +20,8 @@ module IniParse
20
20
  parse_types.replace(types)
21
21
  end
22
22
 
23
- self.parse_types = [ IniParse::Lines::Option,
24
- IniParse::Lines::Section, IniParse::Lines::Blank ]
23
+ self.parse_types = [ IniParse::Lines::Section,
24
+ IniParse::Lines::Option, IniParse::Lines::Blank ]
25
25
 
26
26
  # Creates a new Parser instance for parsing string +source+.
27
27
  #
@@ -47,4 +47,27 @@ describe 'Parsing a document' do
47
47
  lambda { IniParse::Parser.new(fixture(:invalid_line)).parse }.should \
48
48
  raise_error(IniParse::ParseError)
49
49
  end
50
+
51
+ describe 'when a section name contains "="' do
52
+ before(:all) do
53
+ @doc = IniParse::Parser.new(fixture(:section_with_equals)).parse
54
+ end
55
+
56
+ it 'should have two sections' do
57
+ @doc.lines.to_a.length.should == 2
58
+ end
59
+
60
+ it 'should have one section' do
61
+ @doc.lines.keys.should == ['first_section = name',
62
+ 'another_section = a name']
63
+ end
64
+
65
+ it 'should have one option belonging to `first_section = name`' do
66
+ @doc['first_section = name']['key'].should == 'value'
67
+ end
68
+
69
+ it 'should have one option belonging to `another_section = a name`' do
70
+ @doc['another_section = a name']['another'].should == 'thing'
71
+ end
72
+ end
50
73
  end
@@ -46,3 +46,10 @@ FIX
46
46
  IniParse::Test::Fixtures[:invalid_line] = <<-FIX.gsub(/^ /, '')
47
47
  this line is not valid
48
48
  FIX
49
+
50
+ IniParse::Test::Fixtures[:section_with_equals] = <<-FIX.gsub(/^ /, '')
51
+ [first_section = name]
52
+ key = value
53
+ [another_section = a name]
54
+ another = thing
55
+ FIX
metadata CHANGED
@@ -1,52 +1,36 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: iniparse
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 1
9
- - 4
10
- version: 1.1.4
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.5
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Anthony Williams
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2010-09-02 00:00:00 +01:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-12-21 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rspec
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70270665077040 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 62196427
30
- segments:
31
- - 2
32
- - 0
33
- - 0
34
- - beta
35
- - 20
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
36
21
  version: 2.0.0.beta.20
37
22
  type: :development
38
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: *70270665077040
39
25
  description:
40
26
  email: hi@antw.me
41
27
  executables: []
42
-
43
28
  extensions: []
44
-
45
- extra_rdoc_files:
29
+ extra_rdoc_files:
46
30
  - History
47
31
  - LICENSE
48
32
  - README.rdoc
49
- files:
33
+ files:
50
34
  - History
51
35
  - LICENSE
52
36
  - README.rdoc
@@ -75,41 +59,32 @@ files:
75
59
  - spec/spec_fixtures.rb
76
60
  - spec/spec_helper.rb
77
61
  - spec/spec_helper_spec.rb
78
- has_rdoc: true
79
62
  homepage: http://github.com/antw/iniparse
80
63
  licenses: []
81
-
82
64
  post_install_message:
83
- rdoc_options:
65
+ rdoc_options:
84
66
  - --charset=UTF-8
85
- require_paths:
67
+ require_paths:
86
68
  - lib
87
- required_ruby_version: !ruby/object:Gem::Requirement
69
+ required_ruby_version: !ruby/object:Gem::Requirement
88
70
  none: false
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- hash: 3
93
- segments:
94
- - 0
95
- version: "0"
96
- required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
76
  none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
103
- - 0
104
- version: "0"
77
+ requirements:
78
+ - - ! '>='
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
105
81
  requirements: []
106
-
107
82
  rubyforge_project: iniparse
108
- rubygems_version: 1.3.7
83
+ rubygems_version: 1.8.10
109
84
  signing_key:
110
85
  specification_version: 2
111
86
  summary: A pure Ruby library for parsing INI documents.
112
- test_files:
87
+ test_files:
113
88
  - spec/document_spec.rb
114
89
  - spec/fixture_spec.rb
115
90
  - spec/generator/method_missing_spec.rb