omnibus 5.4.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/CHANGELOG.md +21 -0
- data/Gemfile +8 -5
- data/README.md +3 -1
- data/Rakefile +20 -13
- data/appveyor.yml +4 -3
- data/bin/omnibus +3 -3
- data/features/commands/manifest.feature +19 -5
- data/features/step_definitions/generator_steps.rb +5 -6
- data/features/support/env.rb +4 -4
- data/lib/omnibus/build_version.rb +14 -14
- data/lib/omnibus/build_version_dsl.rb +3 -3
- data/lib/omnibus/builder.rb +50 -61
- data/lib/omnibus/changelog.rb +2 -2
- data/lib/omnibus/changelog_printer.rb +4 -4
- data/lib/omnibus/cleaner.rb +4 -4
- data/lib/omnibus/cli/base.rb +15 -15
- data/lib/omnibus/cli/cache.rb +13 -13
- data/lib/omnibus/cli/changelog.rb +8 -9
- data/lib/omnibus/cli/publish.rb +12 -13
- data/lib/omnibus/cli.rb +26 -27
- data/lib/omnibus/compressor.rb +6 -6
- data/lib/omnibus/compressors/base.rb +7 -2
- data/lib/omnibus/compressors/dmg.rb +12 -12
- data/lib/omnibus/compressors/null.rb +1 -1
- data/lib/omnibus/compressors/tgz.rb +8 -8
- data/lib/omnibus/config.rb +37 -26
- data/lib/omnibus/core_extensions/open_uri.rb +3 -3
- data/lib/omnibus/core_extensions.rb +1 -1
- data/lib/omnibus/digestable.rb +5 -4
- data/lib/omnibus/download_helpers.rb +7 -6
- data/lib/omnibus/exceptions.rb +29 -13
- data/lib/omnibus/fetcher.rb +0 -1
- data/lib/omnibus/fetchers/git_fetcher.rb +7 -7
- data/lib/omnibus/fetchers/net_fetcher.rb +19 -19
- data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
- data/lib/omnibus/file_syncer.rb +3 -3
- data/lib/omnibus/generator.rb +60 -47
- data/lib/omnibus/git_cache.rb +33 -22
- data/lib/omnibus/git_repository.rb +5 -5
- data/lib/omnibus/health_check.rb +122 -119
- data/lib/omnibus/instrumentation.rb +1 -1
- data/lib/omnibus/licensing.rb +348 -60
- data/lib/omnibus/logger.rb +12 -9
- data/lib/omnibus/logging.rb +1 -1
- data/lib/omnibus/manifest.rb +4 -4
- data/lib/omnibus/manifest_diff.rb +6 -7
- data/lib/omnibus/manifest_entry.rb +1 -1
- data/lib/omnibus/metadata.rb +36 -36
- data/lib/omnibus/ohai.rb +6 -7
- data/lib/omnibus/package.rb +1 -1
- data/lib/omnibus/packager.rb +37 -28
- data/lib/omnibus/packagers/appx.rb +86 -0
- data/lib/omnibus/packagers/base.rb +21 -18
- data/lib/omnibus/packagers/bff.rb +22 -24
- data/lib/omnibus/packagers/deb.rb +20 -20
- data/lib/omnibus/packagers/ips.rb +18 -17
- data/lib/omnibus/packagers/makeself.rb +7 -7
- data/lib/omnibus/packagers/msi.rb +38 -193
- data/lib/omnibus/packagers/pkg.rb +16 -16
- data/lib/omnibus/packagers/rpm.rb +53 -54
- data/lib/omnibus/packagers/solaris.rb +14 -14
- data/lib/omnibus/packagers/windows_base.rb +192 -0
- data/lib/omnibus/project.rb +45 -43
- data/lib/omnibus/publisher.rb +3 -3
- data/lib/omnibus/publishers/artifactory_publisher.rb +39 -39
- data/lib/omnibus/publishers/s3_publisher.rb +7 -7
- data/lib/omnibus/reports.rb +10 -10
- data/lib/omnibus/s3_cache.rb +7 -7
- data/lib/omnibus/s3_helpers.rb +8 -7
- data/lib/omnibus/semantic_version.rb +1 -1
- data/lib/omnibus/software.rb +131 -81
- data/lib/omnibus/sugarable.rb +10 -10
- data/lib/omnibus/templating.rb +5 -5
- data/lib/omnibus/thread_pool.rb +1 -1
- data/lib/omnibus/util.rb +5 -5
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus.rb +65 -65
- data/omnibus.gemspec +34 -32
- data/resources/appx/AppxManifest.xml.erb +18 -0
- data/resources/appx/assets/clear.png +0 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-bundler-audit-0.5.0-COPYING.txt +674 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/snoopy/snoopy-dependency-licenses.json +24 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mime-types-3.1-Licence.rdoc +25 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mini_portile2-2.1.0-LICENSE.txt +20 -0
- data/spec/fixtures/licensing/license_scout/zlib/zlib-dependency-licenses.json +32 -0
- data/spec/functional/builder_spec.rb +149 -150
- data/spec/functional/fetchers/git_fetcher_spec.rb +69 -71
- data/spec/functional/fetchers/net_fetcher_spec.rb +79 -79
- data/spec/functional/fetchers/path_fetcher_spec.rb +19 -20
- data/spec/functional/file_syncer_spec.rb +74 -74
- data/spec/functional/licensing_spec.rb +344 -35
- data/spec/functional/templating_spec.rb +17 -17
- data/spec/spec_helper.rb +20 -20
- data/spec/support/examples.rb +21 -15
- data/spec/support/file_helpers.rb +1 -1
- data/spec/support/git_helpers.rb +37 -37
- data/spec/support/matchers.rb +3 -3
- data/spec/support/ohai_helpers.rb +4 -4
- data/spec/support/path_helpers.rb +2 -2
- data/spec/support/shell_helpers.rb +2 -2
- data/spec/unit/build_version_dsl_spec.rb +5 -5
- data/spec/unit/build_version_spec.rb +63 -63
- data/spec/unit/builder_spec.rb +86 -70
- data/spec/unit/changelog_spec.rb +4 -4
- data/spec/unit/changelogprinter_spec.rb +130 -0
- data/spec/unit/cleanroom_spec.rb +11 -11
- data/spec/unit/compressor_spec.rb +16 -16
- data/spec/unit/compressors/base_spec.rb +6 -6
- data/spec/unit/compressors/dmg_spec.rb +76 -76
- data/spec/unit/compressors/null_spec.rb +4 -4
- data/spec/unit/compressors/tgz_spec.rb +20 -20
- data/spec/unit/config_spec.rb +44 -43
- data/spec/unit/digestable_spec.rb +13 -13
- data/spec/unit/fetcher_spec.rb +11 -12
- data/spec/unit/fetchers/git_fetcher_spec.rb +31 -31
- data/spec/unit/fetchers/net_fetcher_spec.rb +172 -173
- data/spec/unit/fetchers/path_fetcher_spec.rb +18 -18
- data/spec/unit/generator_spec.rb +38 -38
- data/spec/unit/git_cache_spec.rb +56 -54
- data/spec/unit/git_repository_spec.rb +2 -2
- data/spec/unit/health_check_spec.rb +40 -40
- data/spec/unit/library_spec.rb +35 -35
- data/spec/unit/manifest_diff_spec.rb +10 -11
- data/spec/unit/manifest_spec.rb +17 -17
- data/spec/unit/metadata_spec.rb +152 -152
- data/spec/unit/ohai_spec.rb +5 -5
- data/spec/unit/omnibus_spec.rb +31 -31
- data/spec/unit/package_spec.rb +20 -20
- data/spec/unit/packager_spec.rb +48 -42
- data/spec/unit/packagers/appx_spec.rb +165 -0
- data/spec/unit/packagers/base_spec.rb +34 -34
- data/spec/unit/packagers/bff_spec.rb +60 -60
- data/spec/unit/packagers/deb_spec.rb +71 -71
- data/spec/unit/packagers/ips_spec.rb +45 -45
- data/spec/unit/packagers/makeself_spec.rb +22 -22
- data/spec/unit/packagers/msi_spec.rb +141 -147
- data/spec/unit/packagers/pkg_spec.rb +59 -60
- data/spec/unit/packagers/rpm_spec.rb +125 -126
- data/spec/unit/packagers/solaris_spec.rb +52 -52
- data/spec/unit/project_spec.rb +137 -135
- data/spec/unit/publisher_spec.rb +70 -70
- data/spec/unit/publishers/artifactory_publisher_spec.rb +85 -85
- data/spec/unit/publishers/s3_publisher_spec.rb +36 -36
- data/spec/unit/s3_cacher_spec.rb +34 -34
- data/spec/unit/s3_helpers_spec.rb +6 -6
- data/spec/unit/semantic_version_spec.rb +2 -2
- data/spec/unit/software_spec.rb +346 -384
- data/spec/unit/sugarable_spec.rb +10 -10
- data/spec/unit/util_spec.rb +60 -60
- metadata +54 -6
- data/.rubocop.yml +0 -48
@@ -0,0 +1,215 @@
|
|
1
|
+
inifile [![Build Status](https://secure.travis-ci.org/TwP/inifile.png)](http://travis-ci.org/TwP/inifile)
|
2
|
+
=======
|
3
|
+
|
4
|
+
This is a native Ruby package for reading and writing INI files.
|
5
|
+
|
6
|
+
|
7
|
+
Description
|
8
|
+
-----------
|
9
|
+
|
10
|
+
Although made popular by Windows, INI files can be used on any system thanks
|
11
|
+
to their flexibility. They allow a program to store configuration data, which
|
12
|
+
can then be easily parsed and changed. Two notable systems that use the INI
|
13
|
+
format are Samba and Trac.
|
14
|
+
|
15
|
+
More information about INI files can be found on the [Wikipedia Page](http://en.wikipedia.org/wiki/INI_file).
|
16
|
+
|
17
|
+
### Properties
|
18
|
+
|
19
|
+
The basic element contained in an INI file is the property. Every property has
|
20
|
+
a name and a value, delimited by an equals sign *=*. The name appears to the
|
21
|
+
left of the equals sign and the value to the right.
|
22
|
+
|
23
|
+
name=value
|
24
|
+
|
25
|
+
### Sections
|
26
|
+
|
27
|
+
Section declarations start with *[* and end with *]* as in `[section1]` and
|
28
|
+
`[section2]` shown in the example below. The section declaration marks the
|
29
|
+
beginning of a section. All properties after the section declaration will be
|
30
|
+
associated with that section.
|
31
|
+
|
32
|
+
### Comments
|
33
|
+
|
34
|
+
All lines beginning with a semicolon *;* or a number sign *#* are considered
|
35
|
+
to be comments. Comment lines are ignored when parsing INI files.
|
36
|
+
|
37
|
+
### Example File Format
|
38
|
+
|
39
|
+
A typical INI file might look like this:
|
40
|
+
|
41
|
+
[section1]
|
42
|
+
; some comment on section1
|
43
|
+
var1 = foo
|
44
|
+
var2 = doodle
|
45
|
+
var3 = multiline values \
|
46
|
+
are also possible
|
47
|
+
|
48
|
+
[section2]
|
49
|
+
# another comment
|
50
|
+
var1 = baz
|
51
|
+
var2 = shoodle
|
52
|
+
|
53
|
+
|
54
|
+
Implementation
|
55
|
+
--------------
|
56
|
+
|
57
|
+
The format of INI files is not well defined. Several assumptions are made by
|
58
|
+
the **inifile** gem when parsing INI files. Most of these assumptions can be
|
59
|
+
modified at, but the defaults are listed below.
|
60
|
+
|
61
|
+
### Global Properties
|
62
|
+
|
63
|
+
If the INI file lacks any section declarations, or if there are properties
|
64
|
+
decalared before the first section, then these properties will be placed into
|
65
|
+
a default "global" section. The name of this section can be configured when
|
66
|
+
creating an `IniFile` instance.
|
67
|
+
|
68
|
+
### Duplicate Properties
|
69
|
+
|
70
|
+
Duplicate properties are allowed in a single section. The last property value
|
71
|
+
set is the one that will be stored in the `IniFile` instance.
|
72
|
+
|
73
|
+
[section1]
|
74
|
+
var1 = foo
|
75
|
+
var2 = bar
|
76
|
+
var1 = poodle
|
77
|
+
|
78
|
+
The resulting value of `var1` will be `poodle`.
|
79
|
+
|
80
|
+
### Duplicate Sections
|
81
|
+
|
82
|
+
If you have more than one section with the same name then the sections will be
|
83
|
+
merged. Duplicate properties between the two sections will follow the rules
|
84
|
+
discussed above. Properties in the latter section will override properties in
|
85
|
+
the earlier section.
|
86
|
+
|
87
|
+
### Comments
|
88
|
+
|
89
|
+
The comment character can be either a semicolon *;* or a number sign *#*. The
|
90
|
+
comment character can appear anywhere on a line including at the end of a
|
91
|
+
name/value pair declaration. If you wish to use a comment character in your
|
92
|
+
value then you will need to either escape the character or put the value in
|
93
|
+
double quotations.
|
94
|
+
|
95
|
+
[section1]
|
96
|
+
var1 = foo # a comment
|
97
|
+
var2 = "foo # this is not a comment"
|
98
|
+
var3 = foo \# this is not a comment either
|
99
|
+
|
100
|
+
### Multi-Line Values
|
101
|
+
|
102
|
+
Values can be continued onto multiple lines in two separate ways. Putting a
|
103
|
+
slash at the end of a line will continue the value declaration to the next
|
104
|
+
line. When parsing, the trailing slash will be consumed and **will not**
|
105
|
+
appear in the resulting value. Comments can appear to the right of the
|
106
|
+
trailing slash.
|
107
|
+
|
108
|
+
var1 = this is a \ # these comments will
|
109
|
+
multiline value # be ignored by the parser
|
110
|
+
|
111
|
+
In the above example the resulting value for `var1` will be `this is a
|
112
|
+
multiline value`. If you want to preserve newline characters in the value then
|
113
|
+
quotations should be used.
|
114
|
+
|
115
|
+
var2 = "this is a
|
116
|
+
multiline value"
|
117
|
+
|
118
|
+
The resulting value for `var2` will be `this is a\nmultiline value`.
|
119
|
+
|
120
|
+
### Escape Characters
|
121
|
+
|
122
|
+
Several escape characters are supported within the **value** for a property.
|
123
|
+
These escape sequences will be applied to quoted and unquoted values alike.
|
124
|
+
You can enable or disable escaping by setting the **escape** flag to true or
|
125
|
+
false when creating an IniFile instance.
|
126
|
+
|
127
|
+
* \0 -- null character
|
128
|
+
* \n -- newline character
|
129
|
+
* \r -- carriage return character
|
130
|
+
* \t -- tab character
|
131
|
+
* \\\\ -- backslash character
|
132
|
+
|
133
|
+
The backslash escape sequence is only needed if you want one of the escape
|
134
|
+
sequences to appear literally in your value. For example:
|
135
|
+
|
136
|
+
property = this is not a tab \\t character
|
137
|
+
|
138
|
+
### Value Type Casting
|
139
|
+
|
140
|
+
Some values will be type cast when parsed by the code. Those values are
|
141
|
+
booleans, integers, floats, and empty strings are cast to `nil`.
|
142
|
+
|
143
|
+
* "" --> nil
|
144
|
+
* "42" --> 42
|
145
|
+
* "3.14159" --> 3.14159
|
146
|
+
* "true" --> true
|
147
|
+
* "false" --> false
|
148
|
+
* "normal string" --> "normal string"
|
149
|
+
|
150
|
+
Pretty basic stuff.
|
151
|
+
|
152
|
+
Install
|
153
|
+
-------
|
154
|
+
|
155
|
+
gem install inifile
|
156
|
+
|
157
|
+
|
158
|
+
Testing
|
159
|
+
-------
|
160
|
+
|
161
|
+
To run the tests:
|
162
|
+
|
163
|
+
$ rake
|
164
|
+
|
165
|
+
|
166
|
+
Examples
|
167
|
+
--------
|
168
|
+
|
169
|
+
require 'inifile'
|
170
|
+
myini = IniFile.load('mytest.ini')
|
171
|
+
myini.each_section do |section|
|
172
|
+
puts "I want #{myini[section]['somevar']} printed here!"
|
173
|
+
end
|
174
|
+
|
175
|
+
Contributing
|
176
|
+
------------
|
177
|
+
|
178
|
+
Contributions are gladly welcome! For small modifications (fixing typos,
|
179
|
+
improving documentation) you can use GitHub's in-browser editing capabilities
|
180
|
+
to create a pull request. For larger modifications I would recommend forking
|
181
|
+
the project, creating your patch, and then submitting a pull request.
|
182
|
+
|
183
|
+
Mr Bones is used to manage rake tasks and to install dependent files. To setup
|
184
|
+
your environment ...
|
185
|
+
|
186
|
+
$ gem install bones
|
187
|
+
$ rake gem:install_dependencies
|
188
|
+
|
189
|
+
And always remember that `rake -T` will show you the list of available tasks.
|
190
|
+
|
191
|
+
|
192
|
+
License
|
193
|
+
-------
|
194
|
+
|
195
|
+
MIT License
|
196
|
+
Copyright (c) 2006 - 2014
|
197
|
+
|
198
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
199
|
+
a copy of this software and associated documentation files (the
|
200
|
+
'Software'), to deal in the Software without restriction, including
|
201
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
202
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
203
|
+
permit persons to whom the Software is furnished to do so, subject to
|
204
|
+
the following conditions:
|
205
|
+
|
206
|
+
The above copyright notice and this permission notice shall be
|
207
|
+
included in all copies or substantial portions of the Software.
|
208
|
+
|
209
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
210
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
211
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
212
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
213
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
214
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
215
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"license_manifest_version": 1,
|
3
|
+
"project_name": "snoopy",
|
4
|
+
"dependency_managers": {
|
5
|
+
"ruby_bundler": [
|
6
|
+
{
|
7
|
+
"name": "inifile",
|
8
|
+
"version": "3.0.0",
|
9
|
+
"license": "MIT",
|
10
|
+
"license_files": [
|
11
|
+
"ruby_bundler-inifile-3.0.0-README.md"
|
12
|
+
]
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "bundler-audit",
|
16
|
+
"version": "0.5.0",
|
17
|
+
"license": "GPLv3",
|
18
|
+
"license_files": [
|
19
|
+
"ruby_bundler-bundler-audit-0.5.0-COPYING.txt"
|
20
|
+
]
|
21
|
+
}
|
22
|
+
]
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,215 @@
|
|
1
|
+
inifile [![Build Status](https://secure.travis-ci.org/TwP/inifile.png)](http://travis-ci.org/TwP/inifile)
|
2
|
+
=======
|
3
|
+
|
4
|
+
This is a native Ruby package for reading and writing INI files.
|
5
|
+
|
6
|
+
|
7
|
+
Description
|
8
|
+
-----------
|
9
|
+
|
10
|
+
Although made popular by Windows, INI files can be used on any system thanks
|
11
|
+
to their flexibility. They allow a program to store configuration data, which
|
12
|
+
can then be easily parsed and changed. Two notable systems that use the INI
|
13
|
+
format are Samba and Trac.
|
14
|
+
|
15
|
+
More information about INI files can be found on the [Wikipedia Page](http://en.wikipedia.org/wiki/INI_file).
|
16
|
+
|
17
|
+
### Properties
|
18
|
+
|
19
|
+
The basic element contained in an INI file is the property. Every property has
|
20
|
+
a name and a value, delimited by an equals sign *=*. The name appears to the
|
21
|
+
left of the equals sign and the value to the right.
|
22
|
+
|
23
|
+
name=value
|
24
|
+
|
25
|
+
### Sections
|
26
|
+
|
27
|
+
Section declarations start with *[* and end with *]* as in `[section1]` and
|
28
|
+
`[section2]` shown in the example below. The section declaration marks the
|
29
|
+
beginning of a section. All properties after the section declaration will be
|
30
|
+
associated with that section.
|
31
|
+
|
32
|
+
### Comments
|
33
|
+
|
34
|
+
All lines beginning with a semicolon *;* or a number sign *#* are considered
|
35
|
+
to be comments. Comment lines are ignored when parsing INI files.
|
36
|
+
|
37
|
+
### Example File Format
|
38
|
+
|
39
|
+
A typical INI file might look like this:
|
40
|
+
|
41
|
+
[section1]
|
42
|
+
; some comment on section1
|
43
|
+
var1 = foo
|
44
|
+
var2 = doodle
|
45
|
+
var3 = multiline values \
|
46
|
+
are also possible
|
47
|
+
|
48
|
+
[section2]
|
49
|
+
# another comment
|
50
|
+
var1 = baz
|
51
|
+
var2 = shoodle
|
52
|
+
|
53
|
+
|
54
|
+
Implementation
|
55
|
+
--------------
|
56
|
+
|
57
|
+
The format of INI files is not well defined. Several assumptions are made by
|
58
|
+
the **inifile** gem when parsing INI files. Most of these assumptions can be
|
59
|
+
modified at, but the defaults are listed below.
|
60
|
+
|
61
|
+
### Global Properties
|
62
|
+
|
63
|
+
If the INI file lacks any section declarations, or if there are properties
|
64
|
+
decalared before the first section, then these properties will be placed into
|
65
|
+
a default "global" section. The name of this section can be configured when
|
66
|
+
creating an `IniFile` instance.
|
67
|
+
|
68
|
+
### Duplicate Properties
|
69
|
+
|
70
|
+
Duplicate properties are allowed in a single section. The last property value
|
71
|
+
set is the one that will be stored in the `IniFile` instance.
|
72
|
+
|
73
|
+
[section1]
|
74
|
+
var1 = foo
|
75
|
+
var2 = bar
|
76
|
+
var1 = poodle
|
77
|
+
|
78
|
+
The resulting value of `var1` will be `poodle`.
|
79
|
+
|
80
|
+
### Duplicate Sections
|
81
|
+
|
82
|
+
If you have more than one section with the same name then the sections will be
|
83
|
+
merged. Duplicate properties between the two sections will follow the rules
|
84
|
+
discussed above. Properties in the latter section will override properties in
|
85
|
+
the earlier section.
|
86
|
+
|
87
|
+
### Comments
|
88
|
+
|
89
|
+
The comment character can be either a semicolon *;* or a number sign *#*. The
|
90
|
+
comment character can appear anywhere on a line including at the end of a
|
91
|
+
name/value pair declaration. If you wish to use a comment character in your
|
92
|
+
value then you will need to either escape the character or put the value in
|
93
|
+
double quotations.
|
94
|
+
|
95
|
+
[section1]
|
96
|
+
var1 = foo # a comment
|
97
|
+
var2 = "foo # this is not a comment"
|
98
|
+
var3 = foo \# this is not a comment either
|
99
|
+
|
100
|
+
### Multi-Line Values
|
101
|
+
|
102
|
+
Values can be continued onto multiple lines in two separate ways. Putting a
|
103
|
+
slash at the end of a line will continue the value declaration to the next
|
104
|
+
line. When parsing, the trailing slash will be consumed and **will not**
|
105
|
+
appear in the resulting value. Comments can appear to the right of the
|
106
|
+
trailing slash.
|
107
|
+
|
108
|
+
var1 = this is a \ # these comments will
|
109
|
+
multiline value # be ignored by the parser
|
110
|
+
|
111
|
+
In the above example the resulting value for `var1` will be `this is a
|
112
|
+
multiline value`. If you want to preserve newline characters in the value then
|
113
|
+
quotations should be used.
|
114
|
+
|
115
|
+
var2 = "this is a
|
116
|
+
multiline value"
|
117
|
+
|
118
|
+
The resulting value for `var2` will be `this is a\nmultiline value`.
|
119
|
+
|
120
|
+
### Escape Characters
|
121
|
+
|
122
|
+
Several escape characters are supported within the **value** for a property.
|
123
|
+
These escape sequences will be applied to quoted and unquoted values alike.
|
124
|
+
You can enable or disable escaping by setting the **escape** flag to true or
|
125
|
+
false when creating an IniFile instance.
|
126
|
+
|
127
|
+
* \0 -- null character
|
128
|
+
* \n -- newline character
|
129
|
+
* \r -- carriage return character
|
130
|
+
* \t -- tab character
|
131
|
+
* \\\\ -- backslash character
|
132
|
+
|
133
|
+
The backslash escape sequence is only needed if you want one of the escape
|
134
|
+
sequences to appear literally in your value. For example:
|
135
|
+
|
136
|
+
property = this is not a tab \\t character
|
137
|
+
|
138
|
+
### Value Type Casting
|
139
|
+
|
140
|
+
Some values will be type cast when parsed by the code. Those values are
|
141
|
+
booleans, integers, floats, and empty strings are cast to `nil`.
|
142
|
+
|
143
|
+
* "" --> nil
|
144
|
+
* "42" --> 42
|
145
|
+
* "3.14159" --> 3.14159
|
146
|
+
* "true" --> true
|
147
|
+
* "false" --> false
|
148
|
+
* "normal string" --> "normal string"
|
149
|
+
|
150
|
+
Pretty basic stuff.
|
151
|
+
|
152
|
+
Install
|
153
|
+
-------
|
154
|
+
|
155
|
+
gem install inifile
|
156
|
+
|
157
|
+
|
158
|
+
Testing
|
159
|
+
-------
|
160
|
+
|
161
|
+
To run the tests:
|
162
|
+
|
163
|
+
$ rake
|
164
|
+
|
165
|
+
|
166
|
+
Examples
|
167
|
+
--------
|
168
|
+
|
169
|
+
require 'inifile'
|
170
|
+
myini = IniFile.load('mytest.ini')
|
171
|
+
myini.each_section do |section|
|
172
|
+
puts "I want #{myini[section]['somevar']} printed here!"
|
173
|
+
end
|
174
|
+
|
175
|
+
Contributing
|
176
|
+
------------
|
177
|
+
|
178
|
+
Contributions are gladly welcome! For small modifications (fixing typos,
|
179
|
+
improving documentation) you can use GitHub's in-browser editing capabilities
|
180
|
+
to create a pull request. For larger modifications I would recommend forking
|
181
|
+
the project, creating your patch, and then submitting a pull request.
|
182
|
+
|
183
|
+
Mr Bones is used to manage rake tasks and to install dependent files. To setup
|
184
|
+
your environment ...
|
185
|
+
|
186
|
+
$ gem install bones
|
187
|
+
$ rake gem:install_dependencies
|
188
|
+
|
189
|
+
And always remember that `rake -T` will show you the list of available tasks.
|
190
|
+
|
191
|
+
|
192
|
+
License
|
193
|
+
-------
|
194
|
+
|
195
|
+
MIT License
|
196
|
+
Copyright (c) 2006 - 2014
|
197
|
+
|
198
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
199
|
+
a copy of this software and associated documentation files (the
|
200
|
+
'Software'), to deal in the Software without restriction, including
|
201
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
202
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
203
|
+
permit persons to whom the Software is furnished to do so, subject to
|
204
|
+
the following conditions:
|
205
|
+
|
206
|
+
The above copyright notice and this permission notice shall be
|
207
|
+
included in all copies or substantial portions of the Software.
|
208
|
+
|
209
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
210
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
211
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
212
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
213
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
214
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
215
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
== Licence
|
2
|
+
|
3
|
+
* Copyright 2003–2015 Austin Ziegler and contributors.
|
4
|
+
|
5
|
+
The software in this repository is made available under the MIT license.
|
6
|
+
|
7
|
+
=== MIT License
|
8
|
+
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
10
|
+
this software and associated documentation files (the "Software"), to deal in
|
11
|
+
the Software without restriction, including without limitation the rights to
|
12
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
13
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
14
|
+
so, subject to the following conditions:
|
15
|
+
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
17
|
+
copies or substantial portions of the Software.
|
18
|
+
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
25
|
+
SOFTWARE.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011-2016 Luis Lavena and Mike Dalessio
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"license_manifest_version": 1,
|
3
|
+
"project_name": "zlib",
|
4
|
+
"dependency_managers": {
|
5
|
+
"ruby_bundler": [
|
6
|
+
{
|
7
|
+
"name": "inifile",
|
8
|
+
"version": "3.0.0",
|
9
|
+
"license": "MIT",
|
10
|
+
"license_files": [
|
11
|
+
"ruby_bundler-inifile-3.0.0-README.md"
|
12
|
+
]
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "mime-types",
|
16
|
+
"version": "3.1",
|
17
|
+
"license": "MIT",
|
18
|
+
"license_files": [
|
19
|
+
"ruby_bundler-mime-types-3.1-Licence.rdoc"
|
20
|
+
]
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"name": "mini_portile2",
|
24
|
+
"version": "2.1.0",
|
25
|
+
"license": "MIT",
|
26
|
+
"license_files": [
|
27
|
+
"ruby_bundler-mini_portile2-2.1.0-LICENSE.txt"
|
28
|
+
]
|
29
|
+
}
|
30
|
+
]
|
31
|
+
}
|
32
|
+
}
|