const_conf 0.8.2 → 0.9.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 +4 -4
- data/CHANGES.md +9 -0
- data/const_conf.gemspec +3 -3
- data/lib/const_conf/setting.rb +5 -2
- data/lib/const_conf/version.rb +1 -1
- data/lib/const_conf.rb +5 -2
- data/spec/const_conf_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bce56d92973da4818e0e6fcd37343ea5e27a3902d0dbec7f6ad352dec69705ba
|
|
4
|
+
data.tar.gz: 317afdeca380f7847900eb421f06ced5342b60776a1c370c194408a3536b8285
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8591d5703c6fbe796e220c8c3ecf31330e12981b3cf3806e191cde8efe0bd5410d762d37e4d7fcf7f55b746080155d4a795361470efbc4562553de48b0de9158
|
|
7
|
+
data.tar.gz: 628a002745c8cd17970496b51dc977bab3d6cabd662afe02c7d14286594bb2f75f58424fc8aa7eaac7f114ab1ebe6c1c0c077cf9790e92e6ab4e9000b52d69b6
|
data/CHANGES.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-10-01 v0.9.0
|
|
4
|
+
|
|
5
|
+
* Add `pager:` keyword argument to `ConstConf.view` and `Setting#view`,
|
|
6
|
+
allowing callers to override the pager command used for long output;
|
|
7
|
+
defaults to `ENV['PAGER']` or `less -r`
|
|
8
|
+
* Add YARD `@param pager` documentation to both `view` methods
|
|
9
|
+
* Add spec verifying that a custom `pager:` string is passed through to
|
|
10
|
+
`IO.popen`
|
|
11
|
+
|
|
3
12
|
## 2026-08-20 v0.8.2
|
|
4
13
|
|
|
5
14
|
* Documented block calling contexts for `decode`, `required`, and `check` in
|
data/const_conf.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: const_conf 0.
|
|
2
|
+
# stub: const_conf 0.9.0 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "const_conf".freeze
|
|
6
|
-
s.version = "0.
|
|
6
|
+
s.version = "0.9.0".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]
|
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
|
17
17
|
s.licenses = ["MIT".freeze]
|
|
18
18
|
s.rdoc_options = ["--title".freeze, "ConstConf - Clean DSL for config settings with validation and Rails integration".freeze, "--main".freeze, "README.md".freeze]
|
|
19
19
|
s.required_ruby_version = Gem::Requirement.new(">= 3.2".freeze)
|
|
20
|
-
s.rubygems_version = "4.0.
|
|
20
|
+
s.rubygems_version = "4.0.20".freeze
|
|
21
21
|
s.summary = "Clean DSL for config settings with validation and Rails integration".freeze
|
|
22
22
|
s.test_files = ["spec/const_conf/dir_plugin_spec.rb".freeze, "spec/const_conf/env_dir_extension_spec.rb".freeze, "spec/const_conf/file_plugin_spec.rb".freeze, "spec/const_conf/json_plugin_spec.rb".freeze, "spec/const_conf/setting_accessor_spec.rb".freeze, "spec/const_conf/setting_spec.rb".freeze, "spec/const_conf/tree_spec.rb".freeze, "spec/const_conf/yaml_plugin_spec.rb".freeze, "spec/const_conf_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
|
23
23
|
|
data/lib/const_conf/setting.rb
CHANGED
|
@@ -353,8 +353,11 @@ class ConstConf::Setting
|
|
|
353
353
|
# standard output.
|
|
354
354
|
#
|
|
355
355
|
# @param io [IO, nil] the IO object to write the output to; if nil, uses STDOUT
|
|
356
|
-
|
|
357
|
-
|
|
356
|
+
# @param pager [String, nil] the pager command to use when output exceeds
|
|
357
|
+
# terminal height; if nil, falls back to the PAGER environment variable or
|
|
358
|
+
# `less -r`
|
|
359
|
+
def view(io: nil, pager: nil)
|
|
360
|
+
parent_namespace.view(object: self, io:, pager:)
|
|
358
361
|
end
|
|
359
362
|
|
|
360
363
|
# Returns the string representation of the tree structure.
|
data/lib/const_conf/version.rb
CHANGED
data/lib/const_conf.rb
CHANGED
|
@@ -410,14 +410,17 @@ module ConstConf
|
|
|
410
410
|
# @param object [Object] the ConstConf module or setting to display
|
|
411
411
|
# @param io [IO, nil] the IO object to write the output to; if nil, uses
|
|
412
412
|
# STDOUT
|
|
413
|
-
|
|
413
|
+
# @param pager [String, nil] the pager command for long output; if nil,
|
|
414
|
+
# falls back to the `PAGER` environment variable or `less -r`
|
|
415
|
+
def view(object: self, io: nil, pager: nil)
|
|
416
|
+
pager ||= ENV.fetch('PAGER', 'less -r')
|
|
414
417
|
output = ConstConf::Tree.from_const_conf(object).to_a
|
|
415
418
|
if io
|
|
416
419
|
io.puts output
|
|
417
420
|
elsif output.size < Tins::Terminal.lines
|
|
418
421
|
STDOUT.puts output
|
|
419
422
|
else
|
|
420
|
-
IO.popen(
|
|
423
|
+
IO.popen(pager, ?w) do |f|
|
|
421
424
|
f.puts output
|
|
422
425
|
f.close_write
|
|
423
426
|
end
|
data/spec/const_conf_spec.rb
CHANGED
|
@@ -265,6 +265,12 @@ describe ConstConf do
|
|
|
265
265
|
)
|
|
266
266
|
TestConstConf.view
|
|
267
267
|
end
|
|
268
|
+
|
|
269
|
+
it 'passes custom pager to IO.popen' do
|
|
270
|
+
allow(Tins::Terminal).to receive(:lines).and_return(0)
|
|
271
|
+
expect(IO).to receive(:popen).with('my-custom-pager', ?w)
|
|
272
|
+
TestConstConf.view(pager: 'my-custom-pager')
|
|
273
|
+
end
|
|
268
274
|
end
|
|
269
275
|
|
|
270
276
|
describe '.documentation' 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.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
229
229
|
- !ruby/object:Gem::Version
|
|
230
230
|
version: '0'
|
|
231
231
|
requirements: []
|
|
232
|
-
rubygems_version: 4.0.
|
|
232
|
+
rubygems_version: 4.0.20
|
|
233
233
|
specification_version: 4
|
|
234
234
|
summary: Clean DSL for config settings with validation and Rails integration
|
|
235
235
|
test_files:
|