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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cf52e102562625f71dabce8ff0f05d8d1a0d129e62584a80aae1abd4903585d
4
- data.tar.gz: f59fcc77eb986087131fe84e6770bc667be007ef922cb77477ab54b840e1a75b
3
+ metadata.gz: 996520d6a141a33f05a05cca3318e284646e1513b25ee4c0a4f40cfacc794922
4
+ data.tar.gz: 4c3df5cff5db3806c8e8423c0d6813bd2e180ccf05827b65a80e47f0aa99b29b
5
5
  SHA512:
6
- metadata.gz: 49f9b7c79beae87c9aff4be256de82fafa0f5fe6e76f6243f48c25ded6c0363df8330874ddcb6b7f7719ed2fd9d5ea02d4598491acb1d359c151656d25f060fe
7
- data.tar.gz: afec6d65e82afe81485aa89bf73878e1d95deb96dc04db343edbb9cec980332738743208994a3d57ee2bedfd8f69f124187c134d3fb137a83ee7581920b2eb4b
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 [![Gem Version](https://badge.fury.io/rb/configsl.svg)](https://badge.fury.io/rb/configsl) [![Coverage Status][badge-coverage]][coverage] [![Code Checks](https://github.com/jamesiarmes/configsl/actions/workflows/checks.yaml/badge.svg?branch=main)](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
@@ -19,7 +19,7 @@ module ConfigSL
19
19
 
20
20
  def initialize(params = {})
21
21
  params.each do |name, value|
22
- set_value(name, value)
22
+ set_value(name.to_sym, value)
23
23
  end
24
24
  end
25
25
  end
@@ -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
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ # :nocov:
4
+ module ConfigSL
5
+ VERSION = '1.0.2'
6
+ end
7
+ # :nocov:
data/lib/configsl.rb CHANGED
@@ -1,7 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'configsl/config'
4
-
5
- module ConfigSL
6
- VERSION = '1.0.0'
7
- end
4
+ require_relative 'configsl/version'
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.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-03 00:00:00.000000000 Z
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: []