vagrant_hook 0.1.2 → 0.1.3

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: 5c841b879af503c106244f026563db64b41f2472
4
- data.tar.gz: 67c392129e2657c350cae0521dced09620391855
3
+ metadata.gz: 41013f91effcc4a751e9b1a61ed66b16feb7d5a2
4
+ data.tar.gz: 261cdb98c3a0a2cace659be465aaad959c2620aa
5
5
  SHA512:
6
- metadata.gz: 106b7f95b8600593731bea7a600ef30d70d91fbd80332527ee722863fc53ffb31c872071b26d915533a5e165a8bcb5876fd0210af3bf3eba9ea8841c507f8678
7
- data.tar.gz: b2b7cc2b4cbb058c9b8fe8cee111ceb5e67d0cf397ccda93cb3e81bb2065aefbc4a72ae6c507f740b647419917faf2b62176f16bea9b2cc52c34c0df610755cf
6
+ metadata.gz: b9fca21164dcc48ecbbb9b519f5f6636d2227dad8998aa0bdd9f470cf9ce8ffecd5ed7a6272f5ee5fdf9c849328d2967291a7fdb6885e8a121b51028ef0d1822
7
+ data.tar.gz: 7e7efa5500029919d5c7848ac4d533202621b7a58cf58b71b2e895f3e9819e91b717d7fd21058abb2a2c1612dc57bae0da3657d391a5e87854437ca6d842a6fe
@@ -2,14 +2,20 @@ module VagrantPlugins
2
2
  module VagrantHook
3
3
  class HooksConfig < Vagrant.plugin(2, :config)
4
4
  attr_accessor :check_outdated_callbacks
5
-
5
+ attr_accessor :add_box_callbacks
6
+
6
7
  def initialize
7
8
  @check_outdated_callbacks = []
9
+ @add_box_callbacks = []
8
10
  end
9
11
 
10
- def check_outdated(&proc)
12
+ def on_check_outdated(&proc)
11
13
  @check_outdated_callbacks << {:mproc => proc}
12
14
  end
15
+
16
+ def on_add_box(&proc)
17
+ @add_box_callbacks << {:mproc => proc}
18
+ end
13
19
  end
14
20
 
15
21
  class HookActionAbstract
@@ -19,12 +25,11 @@ module VagrantPlugins
19
25
  end
20
26
 
21
27
  def call(env)
22
- @host = env[:host]
23
-
24
28
  callbacks = @callbacks_list.call
25
29
 
26
30
  callbacks.each do | clbk |
27
- clbk[:mproc].call(@host)
31
+ puts env.to_yaml
32
+ clbk[:mproc].call(env)
28
33
  end
29
34
 
30
35
  @app.call(env)
@@ -36,6 +41,12 @@ module VagrantPlugins
36
41
  super(app, env, Proc.new { env[:machine].config.vagrant_hook.check_outdated_callbacks } )
37
42
  end
38
43
  end
44
+
45
+ class AddBoxHook < HookActionAbstract
46
+ def initialize(app, env)
47
+ super(app, env, Proc.new { env[:machine].config.vagrant_hook.add_box_callbacks } )
48
+ end
49
+ end
39
50
 
40
51
  class Plugin < Vagrant.plugin("2")
41
52
  name "vagrant_hook"
@@ -47,6 +58,10 @@ module VagrantPlugins
47
58
  action_hook(:vagrant_hook, Plugin::ALL_ACTIONS) do |hook|
48
59
  hook.after(Vagrant::Action::Builtin::BoxCheckOutdated, VagrantPlugins::VagrantHook::HookBoxCheckOutdated)
49
60
  end
61
+
62
+ action_hook(:vagrant_hook, Plugin::ALL_ACTIONS) do |hook|
63
+ hook.after(Vagrant::Action::Builtin::BoxAdd, VagrantPlugins::VagrantHook::AddBoxHook)
64
+ end
50
65
  end
51
66
  end
52
67
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module VagrantHook
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant_hook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruben
@@ -53,8 +53,7 @@ files:
53
53
  - lib/vagrant_hook.rb
54
54
  - lib/vagrant_hook/plugin.rb
55
55
  - lib/vagrant_hook/version.rb
56
- - pkg/vagrant_hook-0.1.0.gem
57
- - pkg/vagrant_hook-0.1.1.gem
56
+ - pkg/vagrant_hook-0.1.2.gem
58
57
  - vagrant_hook.gemspec
59
58
  homepage: http://www.github.com/lqbweb
60
59
  licenses: []
Binary file
Binary file