configsl-toml 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 459e5199757f744d707a415291d1e98e14dfe64c774dbbcc7b7cd9fd8715d7ec
4
+ data.tar.gz: 43450c2101f390d41764f3f37f68256835fe0d5b11a70ac8c38adccf42dc71bc
5
+ SHA512:
6
+ metadata.gz: 6e113a7282c79e0d6386cb940eeeefb8e46a8eb50a08d56f04239889f4b0f1641da098822525cac489358845199e227853875a77191b9265003b73152598bb3c
7
+ data.tar.gz: b2cadc349ac45da2ee5185cf60745a0ae472a69620088e43b179e408a5246a305ed3531f8aaff976e529f16a9c19acc4c6d3d63400f5ceabeefc3dc819a16834
data/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog][changelog], and this project adheres
6
+ to [Semantic Versioning][versioning].
7
+
8
+ ## [1.0.0]
9
+
10
+ Initial release.
11
+
12
+ ### Added
13
+
14
+ - Add TOML file format for ConfigSL
15
+
16
+ [changelog]: https://keepachangelog.com/en/1.1.0/
17
+ [versioning]: https://semver.org/spec/v2.0.0.html
data/Gemfile ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ group :development do
8
+ gem 'rake', '~> 13.2'
9
+ gem 'rubocop', '~> 1.65'
10
+ gem 'rubocop-rake', '~> 0.6'
11
+ gem 'rubocop-rspec', '~> 3.0'
12
+ end
13
+
14
+ group :test do
15
+ gem 'coveralls_reborn', '~> 0.28'
16
+ gem 'rspec', '~> 3.13'
17
+ gem 'rspec-github', '~> 2.4'
18
+ gem 'simplecov', '~> 0.22'
19
+ end
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # ConfigSL TOML [![Gem Version][badge-version]][rubygems] [![Coverage Status][badge-coverage]][coverage] [![Code Checks][badge-checks]][checks]
2
+
3
+ Adds [TOML] file support to [ConfigSL], the simple, modular configuration DSL.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'configsl-toml', '~> 1.0'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```sh
16
+ bundle install
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```sh
22
+ gem install configsl-toml
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ See the [ConfigSL Usage documentation][configsl-usage] for information on how to
28
+ use ConfigSL.
29
+
30
+ To add TOML support to your configuration class, require `configsl-toml` and
31
+ register the file format:
32
+
33
+ ```ruby
34
+ require 'configsl'
35
+ require 'configsl-toml'
36
+
37
+ class MyConfig < ConfigSL::Config
38
+ register_file_format :toml
39
+
40
+ option :name, type: String, default: 'My App'
41
+ # ...
42
+ end
43
+ ```
44
+
45
+ [badge-checks]: https://github.com/jamesiarmes/configsl-toml/actions/workflows/checks.yaml/badge.svg?branch=main
46
+ [badge-coverage]: https://coveralls.io/repos/github/jamesiarmes/configsl-toml/badge.svg
47
+ [badge-version]: https://badge.fury.io/rb/configsl-toml.svg
48
+ [checks]: https://github.com/jamesiarmes/configsl/actions/workflows/checks.yaml
49
+ [configsl]: https://github.com/jamesiarmes/configsl
50
+ [configsl-usage]: https://github.com/jamesiarmes/configsl/blob/main/README.md#usage
51
+ [coverage]: https://coveralls.io/github/jamesiarmes/configsl-toml
52
+ [rubygems]: https://rubygems.org/gems/configsl-toml
53
+ [toml]: https://toml.io/en/
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'configsl'
4
+ require 'toml-rb'
5
+
6
+ module ConfigSL
7
+ module FileFormat
8
+ # Support for TOML files.
9
+ class Toml < ConfigSL::FileFormat::Base
10
+ def self.extensions
11
+ %i[toml]
12
+ end
13
+
14
+ def read
15
+ TomlRB.load_file(@file, symbolize_keys: true).each do |name, value|
16
+ yield name, value if block_given?
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # :nocov:
4
+ module ConfigSL
5
+ module Toml
6
+ VERSION = '1.0.0'
7
+ end
8
+ end
9
+ # :nocov:
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'configsl/file_format/toml'
4
+ require_relative 'configsl/toml/version'
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: configsl-toml
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - James I. Armes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-09-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: configsl
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: toml-rb
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
41
+ description: TOML support for ConfigSL.
42
+ email: jamesiarmes@gmail.com
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files:
46
+ - README.md
47
+ - CHANGELOG.md
48
+ files:
49
+ - CHANGELOG.md
50
+ - Gemfile
51
+ - README.md
52
+ - lib/configsl-toml.rb
53
+ - lib/configsl/file_format/toml.rb
54
+ - lib/configsl/toml/version.rb
55
+ homepage: https://github.com/jamesiarmes/configsl-toml
56
+ licenses:
57
+ - MIT
58
+ metadata:
59
+ bug_tracker_uri: https://github.com/jamesiarmes/configsl-toml/issues
60
+ changelog_uri: https://github.com/jamesiarmes/configsl-toml/blob/main/CHANGELOG.md
61
+ homepage_uri: https://github.com/jamesiarmes/configsl-toml
62
+ rubygems_mfa_required: 'true'
63
+ source_code_uri: https://github.com/jamesiarmes/configsl-toml
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '3.2'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubygems_version: 3.5.9
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: TOML support for ConfigSL.
83
+ test_files: []