vagrant-hostel 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,82 +1,4 @@
1
1
  module VagrantHostel
2
- class Config < Vagrant.plugin(2, :config)
3
- def initialize
4
- @__defined_vm_keys = []
5
- @__defined_vms = {}
6
- @replicants = 1
7
- end
8
-
9
- def finalize!
10
- (0..@replicants-1).each do |i|
11
- puts i
12
- end
13
- end
14
-
15
- # Below we mimic (i.e. copy & paste) functionality of Vagrant from:
16
- # VagrantPlugins::Kernel_V2::VMConfig
17
- #
18
- # The aim is to provide our own `define` method to use in place of
19
- # `config.vm.define`
20
- # -------
21
-
22
- DEFAULT_VM_NAME = :default
23
-
24
- def merge(other)
25
- super.tap do |result|
26
- # Merge defined VMs by first merging the defined VM keys,
27
- # preserving the order in which they were defined.
28
- other_defined_vm_keys = other.instance_variable_get(:@__defined_vm_keys)
29
- other_defined_vm_keys -= @__defined_vm_keys
30
- new_defined_vm_keys = @__defined_vm_keys + other_defined_vm_keys
31
-
32
- # Merge the actual defined VMs.
33
- other_defined_vms = other.instance_variable_get(:@__defined_vms)
34
- new_defined_vms = {}
35
-
36
- @__defined_vms.each do |key, subvm|
37
- new_defined_vms[key] = subvm.clone
38
- end
39
-
40
- other_defined_vms.each do |key, subvm|
41
- if !new_defined_vms.has_key?(key)
42
- new_defined_vms[key] = subvm.clone
43
- else
44
- new_defined_vms[key].config_procs.concat(subvm.config_procs)
45
- new_defined_vms[key].options.merge!(subvm.options)
46
- end
47
- end
48
-
49
- result.instance_variable_set(:@__defined_vm_keys, new_defined_vm_keys)
50
- result.instance_variable_set(:@__defined_vms, new_defined_vms)
51
- end
52
- end
53
-
54
- def defined_vms
55
- @__defined_vms
56
- end
57
-
58
- # This returns the keys of the sub-vms in the order they were
59
- # defined.
60
- def defined_vm_keys
61
- @__defined_vm_keys
62
- end
63
-
64
- def define(name, options=nil, &block)
65
- name = name.to_sym
66
- options ||= {}
67
- options[:config_version] ||= "2"
68
-
69
- # Add the name to the array of VM keys. This array is used to
70
- # preserve the order in which VMs are defined.
71
- @__defined_vm_keys << name if !@__defined_vm_keys.include?(name)
72
-
73
- # Add the SubVM to the hash of defined VMs
74
- if !@__defined_vms[name]
75
- @__defined_vms[name] = VagrantConfigSubVM.new
76
- end
77
-
78
- @__defined_vms[name].options.merge!(options)
79
- @__defined_vms[name].config_procs << [options[:config_version], block] if block
80
- end
2
+ class HostelVMConfig < VagrantPlugins::Kernel_V2::VMConfig
81
3
  end
82
4
  end
@@ -0,0 +1,15 @@
1
+ module VagrantHostel
2
+ class MyPlugin < Vagrant.plugin("2")
3
+ name "Hostel"
4
+
5
+ command "hostel" do
6
+ require_relative "command"
7
+ Command
8
+ end
9
+
10
+ config "hostel" do
11
+ require_relative "config"
12
+ HostelVMConfig
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module VagrantHostel
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-hostel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -59,6 +59,7 @@ files:
59
59
  - lib/vagrant-hostel.rb
60
60
  - lib/vagrant-hostel/command.rb
61
61
  - lib/vagrant-hostel/config.rb
62
+ - lib/vagrant-hostel/plugin.rb
62
63
  - lib/vagrant-hostel/version.rb
63
64
  - lib/vagrant_init.rb
64
65
  - vagrant-hostel.gemspec
@@ -77,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
78
  version: '0'
78
79
  segments:
79
80
  - 0
80
- hash: 2234954504471461407
81
+ hash: 2249089570658311103
81
82
  required_rubygems_version: !ruby/object:Gem::Requirement
82
83
  none: false
83
84
  requirements:
@@ -86,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
87
  version: '0'
87
88
  segments:
88
89
  - 0
89
- hash: 2234954504471461407
90
+ hash: 2249089570658311103
90
91
  requirements: []
91
92
  rubyforge_project:
92
93
  rubygems_version: 1.8.25