sistero 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sistero/config.rb +6 -6
- data/lib/sistero/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 830149467db14928da4b414ded663c65a2d8aa69
|
4
|
+
data.tar.gz: 41379a38cc1fc18e3a9d97b2abef3e2d89844c64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9272612e27c28eba9dbc4f2a8a65a7375c29bc6007ebca955b85e817a66082a1fe280bb2cc4669485e5c0d92832a7b57cf5c94408f6c166ae301a7a3cc0bc501
|
7
|
+
data.tar.gz: 0dce93f8d28a487dcf9ef16381590a8d61cad96bcfc6915a68226a8677e0e1c163bdac0328f7ea2df940ab865331e7fe752e0ba34776ce0abcd74c6d97fb9d97
|
data/lib/sistero/config.rb
CHANGED
@@ -35,16 +35,16 @@ module Sistero
|
|
35
35
|
|
36
36
|
def initialize(opts = {})
|
37
37
|
# read defaults from config file
|
38
|
-
cfg_file_path = opts[:cfg_file_path]
|
39
|
-
unless cfg_file_path
|
40
|
-
cfg_file_path = 'sistero.yaml'
|
41
|
-
cfg_file_path = "#{ENV['HOME']}/.config/#{APP_NAME}" unless File.exists? cfg_file_path
|
38
|
+
@cfg_file_path = opts[:cfg_file_path]
|
39
|
+
unless @cfg_file_path
|
40
|
+
@cfg_file_path = 'sistero.yaml'
|
41
|
+
@cfg_file_path = "#{ENV['HOME']}/.config/#{APP_NAME}" unless File.exists? @cfg_file_path
|
42
42
|
end
|
43
43
|
|
44
44
|
@defaults = Profile.new
|
45
45
|
@profiles = []
|
46
46
|
|
47
|
-
cfg = YAML.load_file cfg_file_path
|
47
|
+
cfg = YAML.load_file @cfg_file_path
|
48
48
|
postprocess_cfg cfg
|
49
49
|
|
50
50
|
cfg['defaults'].each do |key, value|
|
@@ -72,7 +72,7 @@ module Sistero
|
|
72
72
|
config.map &method(:postprocess_cfg)
|
73
73
|
elsif config.is_a? Hash
|
74
74
|
if config.length == 1 and config.has_key? 'file'
|
75
|
-
File.read(config['file']).strip
|
75
|
+
File.read(File.join File.dirname(@cfg_file_path), config['file']).strip
|
76
76
|
else
|
77
77
|
config.update(config) { |key, val| postprocess_cfg val }
|
78
78
|
end
|
data/lib/sistero/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sistero
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Pike
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|