fedux_org-stdlib 0.6.13 → 0.6.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60fef56b9f2b99139d04e9f6c2c52f3f4387a48c
4
- data.tar.gz: 2c87c193deb7f904ac38a9267cb0357f3c35171d
3
+ metadata.gz: 8b91278b5c856f0b5196c43ce4c6a1131194f32c
4
+ data.tar.gz: 4a7323abd7bf2c81361b76495013e4fd73c69d81
5
5
  SHA512:
6
- metadata.gz: d073868ecf93d2e205e96afe9ce3c87d5165b31c1f472648955af004bca0d621bb2d9d8d3b1055e91733f414cf9a9e78175fbce93d294cfb2ddc6075fdeddedb
7
- data.tar.gz: e33c28a397bc7ad10d22a6f5f72e977f44905eaa57c91300ac9184899033b64d399730f390ca3f81ce66d6be62ef0862af253b293060fa23fd989cc68edaa87a
6
+ metadata.gz: 7b38a4af025e8b6de93317956cf784142a0f3162280a24b0f31f054d226f1a7bfc442b334c5238b4fd44dcbe64d60117aa3d720d28da22627e947ac19a1c843a
7
+ data.tar.gz: d2c8d64fc7b4d711eabc9b52a74ae81c5b6a4e34cce7599e8feca279fe3c493d4f83aeae4f0e65d26f985c44ba334df6d0677ee4ccfb3affdce38d1821530a26
@@ -235,6 +235,13 @@ module FeduxOrgStdlib
235
235
  result.join("\n")
236
236
  end
237
237
 
238
+ # Return the path to the preferred configuration file
239
+ # @return [String]
240
+ # The path to the preferred configuration file
241
+ def preferred_configuration_file
242
+ _allowed_config_file_paths.first
243
+ end
244
+
238
245
  private
239
246
 
240
247
  # The name of the config file
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # FeduxOrgStdlib
3
3
  module FeduxOrgStdlib
4
- VERSION = '0.6.13'
4
+ VERSION = '0.6.14'
5
5
  end
@@ -91,7 +91,46 @@ RSpec.describe AppConfig do
91
91
  end
92
92
  end
93
93
 
94
+ context '#preferred_configuration_file' do
95
+ it 'has a default configuration file which is the preferred place to store the configuration' do
96
+ with_environment 'HOME' => working_directory do
97
+ config_klass = Class.new(AppConfig) do
98
+
99
+ def _class_name
100
+ 'TestConfig'
101
+ end
102
+
103
+ def _module_name
104
+ 'MyApplication'
105
+ end
106
+ end
107
+
108
+ config = config_klass.new
109
+ expect(config.preferred_configuration_file).to eq File.expand_path('~/.config/my_application/tests.yaml')
110
+ end
111
+ end
112
+
113
+ it 'works with nested module names' do
114
+ with_environment 'HOME' => working_directory do
115
+ config_klass = Class.new(AppConfig) do
116
+
117
+ def _class_name
118
+ 'TestConfig'
119
+ end
120
+
121
+ def _module_name
122
+ 'MyApplication::MySub'
123
+ end
124
+ end
125
+
126
+ config = config_klass.new
127
+ expect(config.preferred_configuration_file).to eq File.expand_path('~/.config/my_application/my_sub/tests.yaml')
128
+ end
129
+ end
130
+ end
131
+
94
132
  context 'config files' do
133
+
95
134
  it 'looks at ~/.test.yaml' do
96
135
  with_environment 'HOME' => working_directory do
97
136
  create_file '.tests.yaml', <<-EOS.strip_heredoc
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.13
4
+ version: 0.6.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Meyer