configsl 1.0.1 → 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: 06cf30d8683d316e9f00f24cf324465c724b04d40a8d7e74df15f8ec33ca95a4
4
- data.tar.gz: '080889e5f38083bce719c9aa789497eab0c70510219446d349e3d79b28f03963'
3
+ metadata.gz: 996520d6a141a33f05a05cca3318e284646e1513b25ee4c0a4f40cfacc794922
4
+ data.tar.gz: 4c3df5cff5db3806c8e8423c0d6813bd2e180ccf05827b65a80e47f0aa99b29b
5
5
  SHA512:
6
- metadata.gz: 418da3e3e16b8663f9ab8fe7bcb3625bb22fc4251eb376345e412aa31b850d9636c7d49e9357277e00fd5faf3f90ba568f7fe7b16aa24bec46b3bb270e551efa
7
- data.tar.gz: 2706b3affda2525f8e3d62d120e960755d972966560bdacdb950f867f24f124058de1dcd98f73baa74fa8b6422ab3d6fca3b1e2467b5bd611d28ef5e464a6736
6
+ metadata.gz: 0d2d5b158111e87a0de35946016c8bd29ed2fdd9b47f85ec72e4224ade52ae292ddbe84bbad7ac48cf0221a57f6fed14d05ff17e54a56a04dfed471078cfbff1
7
+ data.tar.gz: ae533574e3eb01cb827e71eb7319e7028fdd723eb546f85fd28d57bc27d21c76a007724ea075a6366420062fafe03acdc09059ba763168ce19ba4350216760c7
data/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
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
+
8
27
  ## [1.0.1]
9
28
 
10
29
  ### Fixed
@@ -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.1'
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.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James I. Armes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-06 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