const_conf 0.3.1 → 0.4.1

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: 39c7a3e3a930c218b9e3bf2c87b181b720583ce3f9a4fd6639afb3b161ad7e43
4
- data.tar.gz: de6815720e1506d5d0641955d287b3745fd519ae2659e0cd49b253fdbd7eddfa
3
+ metadata.gz: 838d16cd222d34008feff819630c30fe53275d7a4803ef63a998c0688d3b183c
4
+ data.tar.gz: b63b181fa533678a980a230905ebdf1b56d3aaaf2a943c80d8e20766eb6d9b13
5
5
  SHA512:
6
- metadata.gz: 2fa096aa90afd185a5324729a2701dc59245e03b42839fd1180dbed30ce2806eeabb24d3bd8f4addee2c7303e13bc27141bb548ca201dceef8b94c1097b2e8b8
7
- data.tar.gz: 55f209ad258c28d3d3aa368e085a9a61a8120acdb64d98ee9ac94b5209c16b178bd5dfdb0855bd18cf9870d2130c16ecec3123d99d8ec172c63d9c8b3abbb154
6
+ metadata.gz: 04a57e5f48ace4ccf5a148f035cb239cdc5abdc1f9103073b62b2b2f1badd3a10b2adc706023815eb6879006439c4e94eb64e7f5cbf66df5c71f55567de3e707
7
+ data.tar.gz: 015f731fc41e652dc51530f8ba482d58ce4a498ec603b8296e6137e5e5a89f40aefc35abe255437b43219d5aae73b656f8d6cb3f18562f8fe43cfe4ef72a00ac
data/CHANGES.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-10-15 v0.4.1
4
+
5
+ - Added `.github/workflows/static.yml` to deploy static content to GitHub Pages
6
+ - Updated `README.md` to include link to GitHub.io documentation
7
+ - Modified `Rakefile` to ignore `.github` directory and add GitHub workflows
8
+ configuration
9
+ - Configured workflow to use Ruby **3.4** and generate documentation using
10
+ `rake doc`
11
+ - Added workflow dispatch support for manual triggering
12
+ - Configured permissions for pages deployment with read/write access to
13
+ contents and pages
14
+ - Set concurrency to prevent multiple deployments while allowing in-progress
15
+ ones to complete
16
+ - Updated `gem_hadar` development dependency from version **2.6** to **2.8**
17
+ - The gemspec file reflects the updated dependency version for `gem_hadar`
18
+ - The dockerfile now includes `openssl-dev` in the apk add command
19
+
20
+ ## 2025-09-18 v0.4.0
21
+
22
+ - Improved handling of configuration files with trailing whitespace:
23
+ - Added `strip: false` parameter to the `ConstConf::FilePlugin#file` method to
24
+ enable automatic whitespace stripping when `strip: true` is specified
25
+ - Added comprehensive tests for the new strip functionality in
26
+ `file_plugin_spec.rb`
27
+ - Updated the `simplecov` development dependency version from **0.23** to
28
+ **0.22** in both `Rakefile` and `const_conf.gemspec`
29
+
3
30
  ## 2025-09-18 v0.3.1
4
31
 
5
32
  - Replaced `require 'rails'` with `require 'active_support/all'` to reduce
data/README.md CHANGED
@@ -3,6 +3,10 @@
3
3
  **ConstConf**: A robust, thread-safe configuration management library for Ruby
4
4
  applications.
5
5
 
6
+ ## Documentation
7
+
8
+ Complete API documentation is available at: [GitHub.io](https://flori.github.io/const_conf/)
9
+
6
10
  ## Description
7
11
 
8
12
  ConstConf provides a clean DSL for defining configuration settings with
data/Rakefile CHANGED
@@ -18,9 +18,13 @@ GemHadar do
18
18
  ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.AppleDouble', '.bundle',
19
19
  '.yardoc', 'doc', 'tags', 'coverage', 'cscope.out', '.starscope.db'
20
20
  package_ignore '.all_images.yml', '.gitignore', 'VERSION', '.utilsrc',
21
- '.contexts'
21
+ '.contexts', '.github'
22
22
  readme 'README.md'
23
23
 
24
+ github_workflows(
25
+ 'static.yml' => {}
26
+ )
27
+
24
28
  required_ruby_version '~> 3.2'
25
29
 
26
30
  dependency 'tins', '~> 1.43'
@@ -31,7 +35,7 @@ GemHadar do
31
35
  development_dependency 'rspec', '~> 3.13'
32
36
  development_dependency 'context_spook', '~> 0.4'
33
37
  development_dependency 'all_images', '~> 0.8'
34
- development_dependency 'simplecov', '~> 0.23'
38
+ development_dependency 'simplecov', '~> 0.22'
35
39
 
36
40
  licenses << 'MIT'
37
41
  end
data/const_conf.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: const_conf 0.3.1 ruby lib
2
+ # stub: const_conf 0.4.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "const_conf".freeze
6
- s.version = "0.3.1".freeze
6
+ s.version = "0.4.1".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -23,12 +23,12 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.specification_version = 4
25
25
 
26
- s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.6".freeze])
26
+ s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.8".freeze])
27
27
  s.add_development_dependency(%q<debug>.freeze, [">= 0".freeze])
28
28
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.13".freeze])
29
29
  s.add_development_dependency(%q<context_spook>.freeze, ["~> 0.4".freeze])
30
30
  s.add_development_dependency(%q<all_images>.freeze, ["~> 0.8".freeze])
31
- s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.23".freeze])
31
+ s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.22".freeze])
32
32
  s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.43".freeze])
33
33
  s.add_runtime_dependency(%q<json>.freeze, ["~> 2.0".freeze])
34
34
  s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.23".freeze])
@@ -23,9 +23,11 @@ module ConstConf::FilePlugin
23
23
  #
24
24
  # @raise [ConstConf::RequiredValueNotConfigured] if the file does not exist
25
25
  # and required is true
26
- def file(path, required: false)
26
+ def file(path, required: false, strip: false)
27
27
  if File.exist?(path)
28
- File.read(path)
28
+ value = File.read(path)
29
+ strip and value.strip!
30
+ value
29
31
  elsif required
30
32
  raise ConstConf::RequiredValueNotConfigured,
31
33
  "file required at path #{path.to_s.inspect}"
@@ -1,6 +1,6 @@
1
1
  module ConstConf
2
2
  # ConstConf version
3
- VERSION = '0.3.1'
3
+ VERSION = '0.4.1'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -100,6 +100,50 @@ describe ConstConf::FilePlugin do
100
100
  }.to raise_error(ConstConf::RequiredValueNotConfigured)
101
101
  end
102
102
  end
103
+
104
+ context 'with strip option' do
105
+ let(:whitespace_file) { File.join(temp_dir, 'whitespace.txt') }
106
+
107
+ before do
108
+ File.write(whitespace_file, " test_content \n\n")
109
+ end
110
+
111
+ it 'strips whitespace when strip: true is specified' do
112
+ result = instance.file(whitespace_file, strip: true)
113
+ expect(result).to eq "test_content"
114
+ end
115
+
116
+ it 'does not strip whitespace when strip: false (default)' do
117
+ result = instance.file(whitespace_file, strip: false)
118
+ expect(result).to eq " test_content \n\n"
119
+ end
120
+
121
+ it 'does not strip whitespace when strip option is omitted' do
122
+ result = instance.file(whitespace_file)
123
+ expect(result).to eq " test_content \n\n"
124
+ end
125
+
126
+ it 'handles empty files with strip: true' do
127
+ empty_file = File.join(temp_dir, 'empty.txt')
128
+ File.write(empty_file, "")
129
+
130
+ result = instance.file(empty_file, strip: true)
131
+ expect(result).to eq ""
132
+ end
133
+
134
+ it 'handles whitespace-only files with strip: true' do
135
+ whitespace_only_file = File.join(temp_dir, 'whitespace_only.txt')
136
+ File.write(whitespace_only_file, " \n\t ")
137
+
138
+ result = instance.file(whitespace_only_file, strip: true)
139
+ expect(result).to eq ""
140
+ end
141
+
142
+ it 'works correctly with required files and strip option' do
143
+ result = instance.file(whitespace_file, required: true, strip: true)
144
+ expect(result).to eq "test_content"
145
+ end
146
+ end
103
147
  end
104
148
 
105
149
  describe 'integration with ConstConf settings' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: const_conf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '2.6'
18
+ version: '2.8'
19
19
  type: :development
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '2.6'
25
+ version: '2.8'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -85,14 +85,14 @@ dependencies:
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.23'
88
+ version: '0.22'
89
89
  type: :development
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '0.23'
95
+ version: '0.22'
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: tins
98
98
  requirement: !ruby/object:Gem::Requirement