configsl 1.0.0 → 1.0.2
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/CHANGELOG.md +27 -1
- data/README.md +1 -1
- data/lib/configsl/config.rb +1 -1
- data/lib/configsl/file_format/shared_spec.rb +19 -0
- data/lib/configsl/version.rb +7 -0
- data/lib/configsl.rb +1 -4
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 996520d6a141a33f05a05cca3318e284646e1513b25ee4c0a4f40cfacc794922
|
4
|
+
data.tar.gz: 4c3df5cff5db3806c8e8423c0d6813bd2e180ccf05827b65a80e47f0aa99b29b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d2d5b158111e87a0de35946016c8bd29ed2fdd9b47f85ec72e4224ade52ae292ddbe84bbad7ac48cf0221a57f6fed14d05ff17e54a56a04dfed471078cfbff1
|
7
|
+
data.tar.gz: ae533574e3eb01cb827e71eb7319e7028fdd723eb546f85fd28d57bc27d21c76a007724ea075a6366420062fafe03acdc09059ba763168ce19ba4350216760c7
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,33 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
The format is based on [Keep a Changelog][changelog], and this project adheres
|
6
6
|
to [Semantic Versioning][versioning].
|
7
|
-
|
7
|
+
|
8
|
+
## [1.0.2]
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Moved `ConfigSL::VERSION` to `configsl/version` for easier reference.
|
13
|
+
- Exposed the shared example for file formats. Include it in your specs with:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'configsl/file_format/shared_spec'
|
17
|
+
|
18
|
+
RSpec.describe MyFileFormat do
|
19
|
+
it_behaves_like 'a file format', 'spec-config.json', %i[json], {
|
20
|
+
format: 'JSON',
|
21
|
+
name: 'config.json',
|
22
|
+
nested: { title: 'JSON file for testing' }
|
23
|
+
}
|
24
|
+
end
|
25
|
+
```
|
26
|
+
|
27
|
+
## [1.0.1]
|
28
|
+
|
29
|
+
### Fixed
|
30
|
+
|
31
|
+
- Subclasses of `ConfigSL::Config` initialized with sting keys no longer raise
|
32
|
+
an error.
|
33
|
+
|
8
34
|
## 1.0.0
|
9
35
|
|
10
36
|
Initial release.
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# ConfigSL [![Coverage Status][badge-coverage]][coverage]
|
1
|
+
# ConfigSL [](https://badge.fury.io/rb/configsl) [![Coverage Status][badge-coverage]][coverage] [](https://github.com/jamesiarmes/configsl/actions/workflows/checks.yaml)
|
2
2
|
|
3
3
|
ConfigSL is a simple Domain-Specific Language (DSL) module for configuration.
|
4
4
|
It is designed to provide a declarative way to define configuration, with as few
|
data/lib/configsl/config.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
shared_examples 'a file format' do |filename, extensions, expected|
|
4
|
+
subject(:file) { described_class.new(path) }
|
5
|
+
|
6
|
+
let(:path) { "spec/support/fixtures/#{filename}" }
|
7
|
+
|
8
|
+
describe '.extensions' do
|
9
|
+
it 'returns the JSON extension' do
|
10
|
+
expect(described_class.extensions).to eq(extensions)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#read' do
|
15
|
+
it 'returns a hash of configuration values' do
|
16
|
+
expect(file.read).to eq(expected)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/configsl.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: configsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James I. Armes
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facets
|
@@ -41,12 +41,14 @@ files:
|
|
41
41
|
- lib/configsl/exception.rb
|
42
42
|
- lib/configsl/file_format/base.rb
|
43
43
|
- lib/configsl/file_format/json.rb
|
44
|
+
- lib/configsl/file_format/shared_spec.rb
|
44
45
|
- lib/configsl/file_format/yaml.rb
|
45
46
|
- lib/configsl/file_support.rb
|
46
47
|
- lib/configsl/format.rb
|
47
48
|
- lib/configsl/from_environment.rb
|
48
49
|
- lib/configsl/from_file.rb
|
49
50
|
- lib/configsl/validation.rb
|
51
|
+
- lib/configsl/version.rb
|
50
52
|
homepage: https://github.com/jamesiarmes/configsl
|
51
53
|
licenses:
|
52
54
|
- MIT
|
@@ -56,7 +58,7 @@ metadata:
|
|
56
58
|
homepage_uri: https://github.com/jamesiarmes/configsl
|
57
59
|
rubygems_mfa_required: 'true'
|
58
60
|
source_code_uri: https://github.com/jamesiarmes/configsl
|
59
|
-
post_install_message:
|
61
|
+
post_install_message:
|
60
62
|
rdoc_options: []
|
61
63
|
require_paths:
|
62
64
|
- lib
|
@@ -72,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
74
|
version: '0'
|
73
75
|
requirements: []
|
74
76
|
rubygems_version: 3.5.9
|
75
|
-
signing_key:
|
77
|
+
signing_key:
|
76
78
|
specification_version: 4
|
77
79
|
summary: A simple DSL for declarative configuration in ruby.
|
78
80
|
test_files: []
|