fedux_org-stdlib 0.8.6 → 0.8.7

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: ba82feafa5550f36fd7ba991c3fd85ba99331b9e
4
- data.tar.gz: 3df271871db5706484768718d5f3c32d935b9b24
3
+ metadata.gz: 1e5236b00e36418b04fedb9fdabc64f7dff9c0ae
4
+ data.tar.gz: d9883b7a10db200d561bde6567a79c281427785a
5
5
  SHA512:
6
- metadata.gz: 653eb6a33b47bd9e1880a56957e8cde7e0b4e680a1da7e40f4edfef65c9b349f925411483267a8d3ea229845ddef10ee4083245801d91b6200ff39ab56e1ec2e
7
- data.tar.gz: 833c25664b34a57fc52cc32f177e6928a995873de88b6ee3f71807e96747f706a3fb4d107cd51e75465083a4da5d9a9dd0c97547caa2a10d2ddbf43ba3c644ff
6
+ metadata.gz: f0975a290e2fb2a14534a3d32a56de64039aa733b1e3dd58b248f44acfcd2502930c8e54929384bed248123beeb4a166fd7ec9417825999bba59854a40b38d21
7
+ data.tar.gz: 0e2acdd1cca4c126b12e199bc8f3d8d930f137eb504f2e1225271ae5cd7a486c5a0093461d47a5dc2f1cdf410a74c67dcc418bf98c6190780d696619e686b00a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fedux_org-stdlib (0.8.5)
4
+ fedux_org-stdlib (0.8.6)
5
5
  activesupport
6
6
 
7
7
  PATH
@@ -33,7 +33,7 @@ module FeduxOrgStdlib
33
33
  # If you want the class to look for your config file at a different place
34
34
  # overwrite the following method
35
35
  #
36
- # * allowed_config_directory_paths
36
+ # * allowed_directory_paths
37
37
  #
38
38
  # Below you find some examples for the usage of the class:
39
39
  #
@@ -45,7 +45,7 @@ module FeduxOrgStdlib
45
45
  class DirectoryFinder
46
46
  # Create a new instance of config
47
47
  #
48
- # It tries to find a suitable configuration file. If it doesn't find one
48
+ # It tries to find a suitable directory. If it doesn't find one
49
49
  # the config is empty and uses the defaults defined within a config class
50
50
  #
51
51
  # @param [String] file
@@ -69,18 +69,18 @@ module FeduxOrgStdlib
69
69
  )
70
70
  @logger = logger
71
71
  @working_directory = working_directory
72
- @directory ||= (directory || _available_config_directory)
72
+ @directory ||= (directory || _available_directory)
73
73
 
74
74
  unless directory
75
- logger.debug "No configuration directory found at #{_allowed_config_directory_paths.to_list}, therefor I'm going to use an empty config object instead."
75
+ logger.debug "No config directory found at #{_allowed_directory_paths.to_list}, therefor I'm going to use an empty config object instead."
76
76
  end
77
77
  end
78
78
 
79
- # Return the path to the preferred configuration file
79
+ # Return the path to the preferred config file
80
80
  # @return [String]
81
- # The path to the preferred configuration file
82
- def preferred_configuration_directory
83
- _allowed_config_directory_paths.first
81
+ # The path to the preferred config file
82
+ def preferred_directory
83
+ _allowed_directory_paths.first
84
84
  end
85
85
 
86
86
  private
@@ -96,7 +96,7 @@ module FeduxOrgStdlib
96
96
  # class ClientDirectory; end
97
97
  #
98
98
  # This will result in `client` as base name for the config file.
99
- def _config_directory
99
+ def _directory
100
100
  unless (name = _class_name.sub(/Directory/, '').underscore).blank?
101
101
  return name
102
102
  end
@@ -126,13 +126,13 @@ module FeduxOrgStdlib
126
126
  # @return [Array]
127
127
  # A list of paths where the config object should look for its config
128
128
  # file.
129
- def _allowed_config_directory_paths
129
+ def _allowed_directory_paths
130
130
  [
131
- ::File.expand_path(::File.join('~', '.config', _application_name, _config_directory)),
132
- ::File.expand_path(::File.join('~', format('.%s', _application_name), _config_directory)),
133
- ::File.expand_path(::File.join('~', format('.%s', _config_directory))),
134
- ::File.expand_path(::File.join('/etc', _application_name, _config_directory)),
135
- ::File.expand_path(::File.join(working_directory, _config_directory))
131
+ ::File.expand_path(::File.join('~', '.config', _application_name, _directory)),
132
+ ::File.expand_path(::File.join('~', format('.%s', _application_name), _directory)),
133
+ ::File.expand_path(::File.join('~', format('.%s', _directory))),
134
+ ::File.expand_path(::File.join('/etc', _application_name, _directory)),
135
+ ::File.expand_path(::File.join(working_directory, _directory))
136
136
  ]
137
137
  end
138
138
 
@@ -144,8 +144,8 @@ module FeduxOrgStdlib
144
144
  self.class.to_s.deconstantize
145
145
  end
146
146
 
147
- def _available_config_directory
148
- _allowed_config_directory_paths.find { |f| ::File.directory? f }
147
+ def _available_directory
148
+ _allowed_directory_paths.find { |f| ::File.directory? f }
149
149
  end
150
150
  end
151
151
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # FeduxOrgStdlib
3
3
  module FeduxOrgStdlib
4
- VERSION = '0.8.6'
4
+ VERSION = '0.8.7'
5
5
  end
@@ -18,7 +18,7 @@ RSpec.describe DirectoryFinder do
18
18
  end
19
19
 
20
20
  config = config_klass.new
21
- expect(config.preferred_configuration_directory).to eq File.expand_path('~/.config/my_application/test')
21
+ expect(config.preferred_directory).to eq File.expand_path('~/.config/my_application/test')
22
22
  end
23
23
  end
24
24
 
@@ -36,7 +36,7 @@ RSpec.describe DirectoryFinder do
36
36
  end
37
37
 
38
38
  config = config_klass.new
39
- expect(config.preferred_configuration_directory).to eq File.expand_path('~/.config/my_application/my_sub/test')
39
+ expect(config.preferred_directory).to eq File.expand_path('~/.config/my_application/my_sub/test')
40
40
  end
41
41
  end
42
42
  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.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Meyer