vagrant-configuration 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vagrant-configuration/config.rb +9 -6
- data/lib/vagrant-configuration/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 178d64d5dc8c6b39ecebbb9be1f78a709cd0af49
|
4
|
+
data.tar.gz: b6a91772ff40a4f25876e5e07faf81ff79b71e10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aed07fe2fd45d89d5cb2433e00d6e39baa1da8fe7c339b975d2f29bc1152c026bba02d1fcd29da3cde35dc57ab85432b93d9e9acf3e722fc2a0e27f9152c692c
|
7
|
+
data.tar.gz: 551749a97df54ce53820c61e830770174d3ccd1424c9f67553d182c43eb0804fbc5e4192fd921456568779667d2d099e8013e8954344a6d361b49228ef6e9a83
|
@@ -1,18 +1,21 @@
|
|
1
1
|
require 'configuration'
|
2
2
|
|
3
|
-
require "#{ENV['HOME']}/.vagrant.rb"
|
4
|
-
C = Configuration.for 'vagrant'
|
5
|
-
|
6
3
|
module VagrantPlugins
|
7
4
|
module Configuration
|
8
5
|
class Config < Vagrant.plugin("2", :config)
|
6
|
+
def initialize
|
7
|
+
if File.exists? "#{ENV['HOME']}/.vagrant.rb"
|
8
|
+
require "#{ENV['HOME']}/.vagrant.rb"
|
9
|
+
@conf = Configuration.for 'vagrant'
|
10
|
+
end
|
11
|
+
end
|
9
12
|
|
10
13
|
def method_missing(method_id)
|
11
14
|
env = ENV[method_id.to_s.upcase]
|
12
|
-
conf = C.send(method_id)
|
13
15
|
return env if env
|
14
|
-
|
15
|
-
|
16
|
+
res = @conf.send(method_id) if @conf
|
17
|
+
return res if res
|
18
|
+
raise Exception.new("no configuration entry or environment variable was found for #{method_id}")
|
16
19
|
end
|
17
20
|
end
|
18
21
|
|