fedux_org-stdlib 0.9.1 → 0.9.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
  SHA1:
3
- metadata.gz: fd3ede5fd680efaf6f6644e42a016dd9bcf0bae7
4
- data.tar.gz: e027b98e3a5dfb12d1e7f371459d379f061ef673
3
+ metadata.gz: 3370153c7c20104e20c60b2078a36f7e12e1b976
4
+ data.tar.gz: 6470d7d0ed4329c1a84504ba0eb8adc4bbf57658
5
5
  SHA512:
6
- metadata.gz: e39cd7241445e601d42af56ac407bacae6ef36a303633f2724a2bd9a8931dc59d5bacd0dc900774359cad6b54cd8aa7d3a5603fa1477453c1fb635955d97f87f
7
- data.tar.gz: cfa09442548e9f2d142e14c99b02adafc555053dc02f7dded948e303dc1ed3365c419bff573f3b2db9b8814ecf9d7f8831fe17aa9997cc838d0265f981b72fa7
6
+ metadata.gz: 5ca591fdc32795bd8e0cfb27e1dcab2c22221fc28386fd7080df617245aabf1874c2c1e51b6c589b717364aefa8de48a1613eaa259577136392071e40b645cf2
7
+ data.tar.gz: c952c86471ff8c5e26590c8dc6280d585ec58aaec26bbf60a207cb37bbfe5898574d7b129221f3a864d30af8fd06ae12078c43cabaf7100dca9f1c5db081aa1f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fedux_org-stdlib (0.9.0)
4
+ fedux_org-stdlib (0.9.1)
5
5
  activesupport
6
6
 
7
7
  PATH
@@ -274,6 +274,10 @@ module FeduxOrgStdlib
274
274
  config
275
275
  end
276
276
 
277
+ def to_yaml
278
+ Psych.dump known_options.each_with_object({}) { |e, a| a[e.to_s] = self.public_send(e) }
279
+ end
280
+
277
281
  private
278
282
 
279
283
  def detect_file
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # FeduxOrgStdlib
3
3
  module FeduxOrgStdlib
4
- VERSION = '0.9.1'
4
+ VERSION = '0.9.2'
5
5
  end
@@ -479,4 +479,40 @@ RSpec.describe AppConfig do
479
479
  expect(config.class.known_options).to eq config.known_options
480
480
  end
481
481
  end
482
+
483
+ context '#to_yaml' do
484
+ it 'dumps configuration to yaml' do
485
+ config_klass = Class.new(AppConfig) do
486
+ option :opt1, 'test1'
487
+
488
+ option :opt2, [
489
+ 'test2',
490
+ 'test2',
491
+ ]
492
+
493
+ option :opt3, {
494
+ test3: 'value3'
495
+ }
496
+
497
+ def _class_name
498
+ 'TestConfig'
499
+ end
500
+
501
+ def _module_name
502
+ 'MyApplication'
503
+ end
504
+ end
505
+
506
+ config = config_klass.new
507
+ expect(config.to_yaml).to eq <<-EOS.strip_heredoc
508
+ ---
509
+ opt1: test1
510
+ opt2:
511
+ - test2
512
+ - test2
513
+ opt3:
514
+ :test3: value3
515
+ EOS
516
+ end
517
+ end
482
518
  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.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Meyer