fedux_org-stdlib 0.6.46 → 0.6.47

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
  SHA1:
3
- metadata.gz: 4f30dfb18ded39d3f9d21aee9ed56bb87e4d868e
4
- data.tar.gz: 148ee56c2e9d7b9c0eed83934c7a3d0b6e57496d
3
+ metadata.gz: 1ece173128292a383a56c8d916b0e6aae47d5961
4
+ data.tar.gz: f16e7f741547036b3bd0d60a9e8d623c602305d7
5
5
  SHA512:
6
- metadata.gz: e80bfb364cd3b361decb1f761e56966b1cdb5e58f8af6091bf101039d64f0cb803d7970acfecead55a6a7fc1ecb5b8ebfe64e9eea3115fdd6ef941b01012745d
7
- data.tar.gz: 3d1627b20c6916bc742a64aef48f5dd5178907c5818cb15a33386ac0681da05eb79fe557a09b8d231520f1d0c9793ffa2db32a81f64fa63aefad4ca76ae7a1a9
6
+ metadata.gz: b2362f46430bb0e926f7448b0cb2ec667b5d5b3a0514043a2ff189acdeb99467c14cce5f54ebce49c238961e0fd340fe83a59cf82a3ee79b8b51f134241ba0ed
7
+ data.tar.gz: 85003a967218a9b182866e75f716f8b8e4d556c1f12f21714b0ee970401c4260cd52a8884bf8859add1009dc0e9c8af88db9bc8f272c1742c99a6cc521e63d23
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fedux_org-stdlib (0.6.45)
4
+ fedux_org-stdlib (0.6.46)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -2,7 +2,8 @@
2
2
  require 'fedux_org_stdlib/require_files'
3
3
  require 'fedux_org_stdlib/app_config/exceptions'
4
4
  require 'fedux_org_stdlib/process_environment'
5
- require 'fedux_org_stdlib/core_ext/array'
5
+ require 'fedux_org_stdlib/core_ext/array/list'
6
+ require 'fedux_org_stdlib/core_ext/hash/list'
6
7
  require 'fedux_org_stdlib/logging/logger'
7
8
  require_library %w{ json psych active_support/core_ext/string/inflections set active_support/core_ext/hash/slice }
8
9
 
@@ -236,12 +237,15 @@ module FeduxOrgStdlib
236
237
  self.class._known_options.each do |o|
237
238
  value = public_send(o)
238
239
 
239
- value = if value.is_a? Hash
240
- value.to_list
240
+ value = if value.blank?
241
+ Array('is undefined')
242
+ elsif value.is_a?(Hash) || value.is_a?(Array)
243
+ value
241
244
  else
242
- Array(value).to_list
245
+ Array(value)
243
246
  end
244
- result << sprintf("%#{length}s | %s", o, value)
247
+
248
+ result << sprintf("%#{length}s | %s", o, value.to_list)
245
249
  end
246
250
 
247
251
  result.join("\n")
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # FeduxOrgStdlib
3
3
  module FeduxOrgStdlib
4
- VERSION = '0.6.46'
4
+ VERSION = '0.6.47'
5
5
  end
@@ -364,5 +364,32 @@ RSpec.describe AppConfig do
364
364
  EOS
365
365
  end
366
366
  end
367
+
368
+ it 'outputs is undefined for blank values (nil, '', ...)' do
369
+ with_environment 'HOME' => working_directory do
370
+ config_klass = Class.new(AppConfig) do
371
+ option :opt1, nil
372
+ option :opt2, ''
373
+ option :opt3, 'asdf'
374
+
375
+ def _class_name
376
+ 'TestConfig'
377
+ end
378
+
379
+ def _module_name
380
+ 'MyApplication'
381
+ end
382
+ end
383
+
384
+ config = config_klass.new
385
+ expect(config.to_s).to eq <<-EOS.strip_heredoc.chomp
386
+ option | value
387
+ ------ + --------------------------------------------------------------------------------
388
+ opt1 | "is undefined"
389
+ opt2 | "is undefined"
390
+ opt3 | "asdf"
391
+ EOS
392
+ end
393
+ end
367
394
  end
368
395
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fedux_org-stdlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.46
4
+ version: 0.6.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Meyer