vagrant-properties 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vagrant-properties.rb +1 -13
- data/lib/vagrant-properties/config.rb +13 -7
- data/lib/vagrant-properties/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: 8f1efa8e9cb66f2287fdd7196c070fbfc8b301b4
|
4
|
+
data.tar.gz: 0be19e71c18e7579ee11b1e7d4fc2d8eb914307b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aba9022d4ca61c8125d342dd876e9427707d9d5013eaca0716ae3f2d50bf7f72ee9116a45138053785c6177e81b8c3fbb17fa1738618ad0404f2e5c4af906dd
|
7
|
+
data.tar.gz: e76fa19cd4578447f9c240c7f525c0539b081b438440d5eac195ae84cee65fb60efa11cf24d3831345967314b6feda2f669de747e7838802389eb5d7e618c7d8
|
data/lib/vagrant-properties.rb
CHANGED
@@ -1,24 +1,12 @@
|
|
1
1
|
require 'vagrant-properties/version'
|
2
2
|
|
3
3
|
module VagrantPlugins
|
4
|
-
module Properties
|
5
|
-
class << self
|
6
|
-
def enable
|
7
|
-
@enabled = true
|
8
|
-
end
|
9
|
-
|
10
|
-
def enabled?
|
11
|
-
@enabled
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
4
|
module Kernel_V2
|
17
5
|
class Plugin < Vagrant.plugin('2')
|
18
6
|
config('properties') do
|
19
7
|
require File.expand_path('../vagrant-properties/config', __FILE__)
|
20
8
|
Properties::Config
|
21
|
-
end
|
9
|
+
end
|
22
10
|
end
|
23
11
|
end
|
24
12
|
end
|
@@ -4,10 +4,10 @@ require 'yaml'
|
|
4
4
|
module VagrantPlugins
|
5
5
|
module Properties
|
6
6
|
class Config < Vagrant.plugin('2', :config)
|
7
|
-
|
7
|
+
attr_writer :properties_path
|
8
8
|
|
9
|
-
def
|
10
|
-
|
9
|
+
def named(key)
|
10
|
+
self.class.properties[key.to_sym]
|
11
11
|
end
|
12
12
|
|
13
13
|
class << self
|
@@ -16,14 +16,20 @@ module VagrantPlugins
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def build_properties
|
19
|
-
load_properties.
|
20
|
-
|
21
|
-
write_to_hosts
|
19
|
+
load_properties.each_with_object({}) do |(name, property), memo|
|
20
|
+
property['path'] = pull_project(property['repo'])
|
21
|
+
write_to_hosts(property['ip'], property['hostname'])
|
22
|
+
keys = property.keys.inject([]) { |m, k| m << k.to_sym }
|
23
|
+
memo[name.to_sym] = Struct.new(*keys).new(*property.values)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
27
|
+
def properties_path
|
28
|
+
@properties_path ||= 'vagrant_properties.yml'
|
29
|
+
end
|
30
|
+
|
25
31
|
def load_properties
|
26
|
-
YAML.load_file
|
32
|
+
YAML.load_file properties_path
|
27
33
|
end
|
28
34
|
|
29
35
|
def pull_project(repo)
|