localconfig 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/localconfig/config.rb +7 -6
- data/lib/localconfig/version.rb +2 -2
- 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: 8e26ec55b463e0162a17d6fab1a6654ad99b6c75
|
4
|
+
data.tar.gz: b03ebd9c14f8a0a5b6ddc50bb8a947a81e821b8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ffbf1f251062ece9f395b3dcc2ff0bbd047d5f6f4d807da5cac41dfac2cba56e1f1af3d3d411a4e9e2ac21ae2f5bbec91297e41da164680cc02ff047fa8462b
|
7
|
+
data.tar.gz: 0a4ce2810cb3f7ba03c4d35405c6a21010289b35dfad76a85b5cf784c5e91a554d2cdab0d547877e9256fb7fb4c2e7a5f4a7b0d3992bf6ee0cc8fbbbbe373b64
|
data/README.md
CHANGED
data/lib/localconfig/config.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# File : localconfig/config.rb
|
4
4
|
# Maintainer : Felix C. Stegerman <flx@obfusk.net>
|
5
|
-
# Date : 2014-10-
|
5
|
+
# Date : 2014-10-22
|
6
6
|
#
|
7
7
|
# Copyright : Copyright (C) 2014 Felix C. Stegerman
|
8
8
|
# Licence : LGPLv3+
|
@@ -11,6 +11,7 @@
|
|
11
11
|
|
12
12
|
require 'hashie/mash'
|
13
13
|
require 'json'
|
14
|
+
require 'pathname'
|
14
15
|
require 'yaml'
|
15
16
|
|
16
17
|
# namespace
|
@@ -122,7 +123,7 @@ module LocalConfig
|
|
122
123
|
end
|
123
124
|
end
|
124
125
|
|
125
|
-
# <!-- {{{
|
126
|
+
# <!-- {{{2 -->
|
126
127
|
#
|
127
128
|
# clone/fetch git repo in dir (to load more config files from
|
128
129
|
# elsewhere); for example:
|
@@ -145,8 +146,8 @@ module LocalConfig
|
|
145
146
|
# @option opts [String] :tag specific tag
|
146
147
|
# @option opts [String] :branch specific branch
|
147
148
|
#
|
148
|
-
# <!-- }}}
|
149
|
-
def git_repo(path, url, opts = {}) # {{{
|
149
|
+
# <!-- }}}2 -->
|
150
|
+
def git_repo(path, url, opts = {}) # {{{2
|
150
151
|
q = opts.fetch(:quiet, true) ? %w{ --quiet } : []
|
151
152
|
b = opts[:branch]; b = "origin/#{b}" if b && !b['/']
|
152
153
|
rev = opts[:rev] || opts[:tag]
|
@@ -164,7 +165,7 @@ module LocalConfig
|
|
164
165
|
Dir.chdir(dest) do
|
165
166
|
_sys *(%w{ git reset --hard } + q + [ref] + %w{ -- })
|
166
167
|
end
|
167
|
-
end # }}}
|
168
|
+
end # }}}2
|
168
169
|
|
169
170
|
# --
|
170
171
|
|
@@ -188,7 +189,7 @@ module LocalConfig
|
|
188
189
|
ext = exts.find { |x| b.end_with? x } || ''
|
189
190
|
k = File.basename b, ext ; c_k = (pre+[k]).first
|
190
191
|
o = @config
|
191
|
-
pre.each { |x| o
|
192
|
+
pre.each { |x| o[x] ||= Hashie::Mash.new; o = o[x] }
|
192
193
|
raise "self.#{(pre+[k])*'.'} already set" if o[k]
|
193
194
|
o[k] = Hashie::Mash.new parse[File.read(f[:path])]
|
194
195
|
define_singleton_method(c_k) { @config[c_k] } \
|
data/lib/localconfig/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: localconfig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix C. Stegerman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|