vagrant-configuration 0.0.3 → 0.0.4
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 +8 -4
- 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: d1e96cb3a8d9f2aff0a633e2e6c36b34de13a9b3
|
4
|
+
data.tar.gz: 83aab89d0daaeb1cc30b41ff90c15b51d2a0014f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cdc85fc8a2157dfcdae01add90e0e79ee745983506f336f691eca891d974896111e72d075e3d2a4f04bc48c78e83cf311dacd7483306af782621cc4573ba867
|
7
|
+
data.tar.gz: 71f5278d73c38d6ecfe6ae98eaf806c31307c901bff002fdf262a2327b39aabaa8f6cd7ce3ec80c7addab2888ea84f7325234ddb6232fc8f140e344626381404
|
@@ -1,19 +1,23 @@
|
|
1
1
|
require 'configuration'
|
2
|
-
|
2
|
+
C = Configuration
|
3
3
|
module VagrantPlugins
|
4
4
|
module Configuration
|
5
5
|
class Config < Vagrant.plugin("2", :config)
|
6
6
|
def initialize
|
7
|
-
if File.
|
7
|
+
if File.exist? "#{ENV['HOME']}/.vagrant.rb"
|
8
8
|
require "#{ENV['HOME']}/.vagrant.rb"
|
9
|
-
@conf =
|
9
|
+
@conf = C.for 'vagrant'
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
def method_missing(method_id)
|
14
14
|
env = ENV[method_id.to_s.upcase]
|
15
15
|
return env if env
|
16
|
-
|
16
|
+
begin
|
17
|
+
res = @conf.send(method_id) if @conf
|
18
|
+
rescue
|
19
|
+
puts "#{method_id} not found in #{ENV['HOME']}/.vagrant.rb"
|
20
|
+
end
|
17
21
|
return res if res
|
18
22
|
raise Exception.new("no configuration entry or environment variable was found for #{method_id}")
|
19
23
|
end
|