runcom 1.0.0 → 1.1.0

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: '0079d1916af6b0a44c839bbd3f61988c5efe1bff'
4
- data.tar.gz: 2d41953a849b8c6b7a41f881ff552934876b160b
3
+ metadata.gz: de9fc61f22105a7512873b2de04986b170178197
4
+ data.tar.gz: 6eabbc78f1aca0ec3a88dc9a2b32e8f6e2597f98
5
5
  SHA512:
6
- metadata.gz: ba0a18fb05999333917446f60d817df0256d68c9987ef66b55c54f2e4e753b687b0c699783ba99d3fa0cc1577e55887877d8137c097801c9c4fb6ef210e88396
7
- data.tar.gz: 340f0063f2ddf39d5bd90ffa82d59c771238a1a17011f3993c01611df8c44612e003dc97974119914cc1dde9b811133bc0dfefba7140d3045d1c96bd7522ab4f
6
+ metadata.gz: 4c5131885949c6d63fa45c0a398d184a0186298ded436f7b1017d31a9810f8794bdb931bdb5a613a11eb2497bc3044a97f059f4cf807f7f15821352daf580be8
7
+ data.tar.gz: 0fc80005cea97256ee64951875169a048434034498f6d92019d98f992b85734171ddc7b28e154f66afcbcdbaf7067968d9d569ef9d8e3fcb9446ad16a9ffea11
@@ -12,7 +12,7 @@ module Runcom
12
12
  attr_reader :path
13
13
 
14
14
  def initialize project_name:, file_name: "configuration.yml", defaults: {}
15
- @path = Pathname "#{XDG::Configuration.computed_dir}/#{project_name}/#{file_name}"
15
+ @path = load_path project_name, file_name
16
16
  @defaults = defaults
17
17
  @settings = defaults.deep_merge load_settings
18
18
  end
@@ -27,7 +27,12 @@ module Runcom
27
27
 
28
28
  private
29
29
 
30
- attr_reader :file_path, :defaults, :settings
30
+ attr_reader :paths, :defaults, :settings
31
+
32
+ def load_path project, file
33
+ paths = XDG::Configuration.computed_dirs.map { |root| Pathname "#{root}/#{project}/#{file}" }
34
+ paths.find(&:exist?)
35
+ end
31
36
 
32
37
  def load_settings
33
38
  yaml = YAML.load_file path
@@ -12,7 +12,7 @@ module Runcom
12
12
  end
13
13
 
14
14
  def self.version
15
- "1.0.0"
15
+ "1.1.0"
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -21,10 +21,6 @@ module Runcom
21
21
  directories = dirs.unshift(home_dir).map { |directory| Pathname(directory).expand_path }
22
22
  directories.select(&:exist?)
23
23
  end
24
-
25
- def self.computed_dir
26
- computed_dirs.first
27
- end
28
24
  end
29
25
  end
30
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runcom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-12 00:00:00.000000000 Z
11
+ date: 2017-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: refinements