parseconfig 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog +7 -0
- data/LICENSE +1 -1
- data/README.md +49 -1
- data/lib/parseconfig.rb +6 -2
- data/lib/version.rb +1 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d3c3c0e6a2c362a4d7afb9c6ecef637497b94137e570b96c3eade26f07f8825
|
4
|
+
data.tar.gz: ae849249bce23a5988a51159e388237af2540883dc60de7d164e14501c3d484d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f49ecd6162b3a6f6bb6140f7a44666f312e6682862e8e6957ce28792b4e5e1629b815e981b409ee0588a9309d2c4dbdcce595b3f42e2bee390f6439731b6c54
|
7
|
+
data.tar.gz: bfc2d1519921b14744d873bf71ad76b3da18068cc0929ce59baac5757e0dcb5948b59a86940e2141ee99530ef436787157f4a04726c8562762979f48c8708996
|
data/Changelog
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
|
2
|
+
Wed Sep 29, 2021 - v1.1.1 (DEVELOPMENT - will be released as 1.1.2)
|
3
|
+
- Dev and test against recent versions of Ruby (2.6+, 3.0+)
|
4
|
+
- Docker development support
|
5
|
+
- Remove tests for deprecated 'get_value()' method
|
6
|
+
- Use Rspec 'expect' in place of 'should'
|
7
|
+
|
1
8
|
Mon Sep 28, 2020 - v1.1.0
|
2
9
|
- Add non-value option support.
|
3
10
|
Resolves Issue #11
|
data/LICENSE
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
The MIT License:
|
3
3
|
|
4
|
-
Copyright (c) 2006
|
4
|
+
Copyright (c) 2006 Data Folk Labs, LLC
|
5
5
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
ParseConfig provides simple parsing of standard configuration files in the
|
4
4
|
form of `param = value`. It also supports nested `[group]` sections.
|
5
5
|
|
6
|
-
[![Continuous Integration Status](https://
|
6
|
+
[![Continuous Integration Status](https://app.travis-ci.com/datafolklabs/ruby-parseconfig.svg?branch=master)](https://app.travis-ci.com/github/datafolklabs/ruby-parseconfig)
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
@@ -84,8 +84,56 @@ Access it with ParseConfig:
|
|
84
84
|
|
85
85
|
```
|
86
86
|
|
87
|
+
## Development
|
88
|
+
|
89
|
+
### Docker
|
90
|
+
|
91
|
+
This project includes a `docker-compose` configuration that sets up all required services, and dependencies for development and testing. This is the recommended path for local development, and is the only fully supported option.
|
92
|
+
|
93
|
+
The following creates all required docker containers, and launches a BASH shell within the `parseconfig` dev container for development.
|
94
|
+
```
|
95
|
+
$ make dev
|
96
|
+
|
97
|
+
|> parseconfig <| src #
|
98
|
+
```
|
99
|
+
|
100
|
+
The above is the equivalent of running:
|
101
|
+
|
102
|
+
```
|
103
|
+
$ docker-compose up -d
|
104
|
+
|
105
|
+
$ docker-compose exec parseconfig /bin/bash
|
106
|
+
```
|
107
|
+
|
108
|
+
**Testing Alternative Versions of Ruby**
|
109
|
+
|
110
|
+
The latest stable version of Ruby is the default, and target version accessible as the `parseconfig` container within Docker Compose. For testing against alternative versions of Ruby, additional containers are created (ex: `parseconfig-rb26`, `parseconfig-rb27`, etc). You can access these containers via:
|
111
|
+
|
112
|
+
```
|
113
|
+
$ docker-compose ps
|
114
|
+
Name Command State Ports
|
115
|
+
---------------------------------------------------------------
|
116
|
+
ruby-parseconfig_parseconfig-rb26_1 /bin/bash Up
|
117
|
+
ruby-parseconfig_parseconfig-rb27_1 /bin/bash Up
|
118
|
+
ruby-parseconfig_parseconfig-rb30_1 /bin/bash Up
|
119
|
+
ruby-parseconfig_parseconfig_1 /bin/bash Up
|
120
|
+
|
121
|
+
|
122
|
+
$ docker-compose exec parseconfig-rb26 /bin/bash
|
123
|
+
|
124
|
+
|> parseconfig-rb26 <| src #
|
125
|
+
```
|
126
|
+
|
127
|
+
### Running Unit Tests
|
128
|
+
|
129
|
+
```
|
130
|
+
$ make test
|
131
|
+
```
|
132
|
+
|
133
|
+
|
87
134
|
## License
|
88
135
|
|
89
136
|
The ParseConfig library is Open Source and distributed under the MIT license.
|
90
137
|
Please see the LICENSE file included with this software.
|
91
138
|
|
139
|
+
|
data/lib/parseconfig.rb
CHANGED
@@ -93,8 +93,8 @@ class ParseConfig
|
|
93
93
|
else
|
94
94
|
add(var_name, new_value)
|
95
95
|
end
|
96
|
-
elsif /^\[(.+)\]
|
97
|
-
group = /^\[(.+)\]
|
96
|
+
elsif /^\[(.+)\](\s*#{escaped_comment_regex}+.*)?$/.match(line).to_a != []
|
97
|
+
group = /^\[(.+)\](\s*#{escaped_comment_regex}+.*)?$/.match(line).to_a[1]
|
98
98
|
add(group, {})
|
99
99
|
elsif /\w+/.match(line)
|
100
100
|
add(line.to_s.chomp.strip, true)
|
@@ -104,6 +104,10 @@ class ParseConfig
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
+
def escaped_comment_regex
|
108
|
+
/[#{Regexp.escape(@comments.join(''))}]/
|
109
|
+
end
|
110
|
+
|
107
111
|
# This method will provide the value held by the object "@param"
|
108
112
|
# where "@param" is actually the name of the param in the config
|
109
113
|
# file.
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parseconfig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BJ Dierkes
|
8
|
-
|
8
|
+
- Dmitry Shagin
|
9
|
+
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2021-09-30 00:00:00.000000000 Z
|
12
13
|
dependencies: []
|
13
14
|
description: ParseConfig provides simple parsing of standardconfiguration files in
|
14
15
|
the form of 'param = value'. It also supports nested [group] sections.
|
15
|
-
email:
|
16
|
+
email: team@datafolklabs.com
|
16
17
|
executables: []
|
17
18
|
extensions: []
|
18
19
|
extra_rdoc_files: []
|
@@ -23,9 +24,10 @@ files:
|
|
23
24
|
- lib/parseconfig.rb
|
24
25
|
- lib/version.rb
|
25
26
|
homepage: http://github.com/datafolklabs/ruby-parseconfig/
|
26
|
-
licenses:
|
27
|
+
licenses:
|
28
|
+
- MIT
|
27
29
|
metadata: {}
|
28
|
-
post_install_message:
|
30
|
+
post_install_message:
|
29
31
|
rdoc_options: []
|
30
32
|
require_paths:
|
31
33
|
- lib
|
@@ -40,8 +42,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
42
|
- !ruby/object:Gem::Version
|
41
43
|
version: '0'
|
42
44
|
requirements: []
|
43
|
-
rubygems_version: 3.0.
|
44
|
-
signing_key:
|
45
|
+
rubygems_version: 3.0.3
|
46
|
+
signing_key:
|
45
47
|
specification_version: 4
|
46
48
|
summary: Config File Parser for Standard Unix/Linux Type Config Files
|
47
49
|
test_files: []
|