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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69720f49e2aaf298ba101c6cf4b62d19896ccabc
4
- data.tar.gz: 08cdc94023f7e7c30c61d0b876c109c625806786
3
+ metadata.gz: 8e26ec55b463e0162a17d6fab1a6654ad99b6c75
4
+ data.tar.gz: b03ebd9c14f8a0a5b6ddc50bb8a947a81e821b8e
5
5
  SHA512:
6
- metadata.gz: 899ffc8ed6c89e921ba45511ef76a3f93e3bb166b819916f19e5ce71afb05502c9dd2d4eeda10da6797008bba7f1bd1907cae4cfef854a097bf436ed4f2e7dda
7
- data.tar.gz: 5056aaf7eb5d76e79a57619a989ca3d47dc040a64e2959f35ce34972473f7e958dacb287a26ec1d8b81ae34eb938957bbc6d860df614762eca57f31743e1b9e9
6
+ metadata.gz: 8ffbf1f251062ece9f395b3dcc2ff0bbd047d5f6f4d807da5cac41dfac2cba56e1f1af3d3d411a4e9e2ac21ae2f5bbec91297e41da164680cc02ff047fa8462b
7
+ data.tar.gz: 0a4ce2810cb3f7ba03c4d35405c6a21010289b35dfad76a85b5cf784c5e91a554d2cdab0d547877e9256fb7fb4c2e7a5f4a7b0d3992bf6ee0cc8fbbbbe373b64
data/README.md CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  File : README.md
4
4
  Maintainer : Felix C. Stegerman <flx@obfusk.net>
5
- Date : 2014-10-21
5
+ Date : 2014-10-22
6
6
 
7
7
  Copyright : Copyright (C) 2014 Felix C. Stegerman
8
- Version : v0.3.0
8
+ Version : v0.3.1
9
9
 
10
10
  []: }}}1
11
11
 
@@ -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-21
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
- # <!-- {{{1 -->
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
- # <!-- }}}1 -->
149
- def git_repo(path, url, opts = {}) # {{{1
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 # }}}1
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 = o[x] ||= Hashie::Mash.new }
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] } \
@@ -1,4 +1,4 @@
1
1
  module LocalConfig
2
- VERSION = '0.3.0'
3
- DATE = '2014-10-21'
2
+ VERSION = '0.3.1'
3
+ DATE = '2014-10-22'
4
4
  end
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.0
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-21 00:00:00.000000000 Z
11
+ date: 2014-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie