iniparse 1.2.0 → 1.3.0
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 +4 -4
- data/README.rdoc +8 -0
- data/iniparse.gemspec +2 -2
- data/lib/iniparse.rb +1 -1
- data/lib/iniparse/document.rb +9 -0
- data/lib/iniparse/line_collection.rb +2 -0
- data/lib/iniparse/lines.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6b464db624dce7fb8e739ef4052ae6731160b5c
|
4
|
+
data.tar.gz: 34a23d15c017f66eb3c3a8b917de440c9bfcdbe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b31696c7ba53c6491a52371e34dc9b72c44eb8e4ba78009f3167b67df0a2642308bc7fd8ed5f76bc4ba5fd24fe4477faeb9d27ada8e2d262b340f161d55c40c
|
7
|
+
data.tar.gz: 90e65a58a1ac00d42bcd096a8542dbf0b32272d786661c827fceefaf66862f9a0eb46e2aa18b91bccdccb1f85987f0707f9ada537a2dd2ff04d9441fe041f4ce
|
data/README.rdoc
CHANGED
@@ -88,6 +88,14 @@ Options which appear before the first section will be added to a section called
|
|
88
88
|
document['a_section']['an_option']
|
89
89
|
# => "a new value"
|
90
90
|
|
91
|
+
Delete entire sections by calling `#delete` with the section name...
|
92
|
+
|
93
|
+
document.delete('a_section')
|
94
|
+
|
95
|
+
... or a single option with `#delete` on the section object:
|
96
|
+
|
97
|
+
document['a_section'].delete('an_option')
|
98
|
+
|
91
99
|
=== Creating a new INI file
|
92
100
|
|
93
101
|
See IniParse::Generator.
|
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.
|
16
|
-
s.date = '2014-04-
|
15
|
+
s.version = '1.3.0'
|
16
|
+
s.date = '2014-04-09'
|
17
17
|
s.rubyforge_project = 'iniparse'
|
18
18
|
|
19
19
|
s.summary = 'A pure Ruby library for parsing INI documents.'
|
data/lib/iniparse.rb
CHANGED
data/lib/iniparse/document.rb
CHANGED
@@ -32,6 +32,15 @@ module IniParse
|
|
32
32
|
@lines[key.to_s]
|
33
33
|
end
|
34
34
|
|
35
|
+
# Deletes the section whose name matches the given +key+.
|
36
|
+
#
|
37
|
+
# Returns the document.
|
38
|
+
#
|
39
|
+
def delete(*args)
|
40
|
+
@lines.delete(*args)
|
41
|
+
self
|
42
|
+
end
|
43
|
+
|
35
44
|
# Returns this document as a string suitable for saving to a file.
|
36
45
|
def to_ini
|
37
46
|
@lines.to_a.map { |line| line.to_ini }.join($/)
|
data/lib/iniparse/lines.rb
CHANGED
@@ -153,6 +153,15 @@ module IniParse
|
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
156
|
+
# Deletes the option identified by +key+.
|
157
|
+
#
|
158
|
+
# Returns the section.
|
159
|
+
#
|
160
|
+
def delete(*args)
|
161
|
+
@lines.delete(*args)
|
162
|
+
self
|
163
|
+
end
|
164
|
+
|
156
165
|
# Like [], except instead of returning just the option value, it returns
|
157
166
|
# the matching line instance.
|
158
167
|
#
|
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.
|
4
|
+
version: 1.3.0
|
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-
|
11
|
+
date: 2014-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|