vagrant-powder 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a206769c05b583e52c1b4b03e7114602d98e7856
4
- data.tar.gz: 7f591ac7559863de7c66e0f7f164ef610f99b104
3
+ metadata.gz: 378d32ed09595c009f149416c3c282ed53ea0f6a
4
+ data.tar.gz: f2f8d19adb8b729b851de6753a09986c377bede6
5
5
  SHA512:
6
- metadata.gz: 57c58d6f2df542d7961d9a90039ce791983f59214688e3b78a4459d72efaaeecba021366809a2c0d5ca70c97681f3c36fae91852ab764cb2faf491e573bed7b2
7
- data.tar.gz: 3837cf907c27463b49b47a33d2a95584ff0ddb1027dba6854ff1701736f02ac667531eaac76ee04bfca9a0bd5c085af4c0b16ba7e38380064a147c714a176443
6
+ metadata.gz: 9dda6cdfe5438bcd5814e9bf91e234a78008be753403415c334a5e91eb7e3c453f618b92c8b907973b0cf739722ea691669700742cfd3445d57a738e78c7dbc8
7
+ data.tar.gz: dc8a93128fcf838eaa53c093a7070a859ae438846ee7f0afada2b6f72c73adbacf367a330490bf89ccee793a53ef110b2699bd904c66442d0a140266e32fc730
@@ -1,4 +1,7 @@
1
1
  Vagrant.configure("2") do |config|
2
2
  config.vm.box = "hashicorp/precise64"
3
3
  config.vm.box_url = "http://files.vagrantup.com/precise64.box"
4
+
5
+ config.powder.enabled = true
6
+ config.powder.link_name = "powdertest"
4
7
  end
@@ -11,6 +11,7 @@ module VagrantPlugins
11
11
  end
12
12
 
13
13
  def call(env)
14
+
14
15
  # Before machine action
15
16
  state = env[:machine].state.id
16
17
 
@@ -18,20 +19,24 @@ module VagrantPlugins
18
19
  @app.call(env)
19
20
 
20
21
  # After execute machine action
21
- config = env[:machine].config.Pushbullet
22
+ config = env[:machine].config.powder
22
23
  action = env[:machine_action]
23
24
  provision = env[:provision_enabled]
24
25
 
25
- case action
26
- when :up
27
- puts "Powder unlink"
28
- `powder unlink`
29
- when :halt
30
- puts "Powder link"
31
- `powder link`
32
- when :destroy
33
- puts "powder link"
34
- `powder link`
26
+ if config.enabled
27
+
28
+ case action
29
+ when :up
30
+ puts "Powder unlink #{config.link_name}"
31
+ `powder unlink #{config.link_name}`
32
+ when :halt
33
+ puts "Powder link #{config.link_name}"
34
+ `powder link #{config.link_name}`
35
+ when :destroy
36
+ puts "powder link #{config.link_name}"
37
+ `powder link #{config.link_name}`
38
+ end
39
+
35
40
  end
36
41
  end
37
42
 
@@ -0,0 +1,22 @@
1
+ module VagrantPlugins
2
+ module Powder
3
+
4
+ class Config < Vagrant.plugin('2', :config)
5
+
6
+ attr_accessor :enabled
7
+ attr_accessor :link_name
8
+
9
+ def initialize
10
+ @enabled = UNSET_VALUE
11
+ @link_name = UNSET_VALUE
12
+ end
13
+
14
+ def finalize!
15
+ @enabled = false if @enabled == UNSET_VALUE
16
+ @link_name = File.basename(Dir.getwd) if @link_name == UNSET_VALUE
17
+ end
18
+
19
+ end
20
+
21
+ end
22
+ end
@@ -18,6 +18,11 @@ module VagrantPlugins
18
18
  Command
19
19
  end
20
20
 
21
+ config "powder" do
22
+ require_relative "config"
23
+ Config
24
+ end
25
+
21
26
  action_hook("Powder_hook", :machine_action_up) do |hook|
22
27
  require_relative "action"
23
28
  hook.prepend(Action)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Powder
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-powder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Kratzat
@@ -82,6 +82,7 @@ files:
82
82
  - lib/vagrant-powder.rb
83
83
  - lib/vagrant-powder/action.rb
84
84
  - lib/vagrant-powder/command.rb
85
+ - lib/vagrant-powder/config.rb
85
86
  - lib/vagrant-powder/plugin.rb
86
87
  - lib/vagrant-powder/version.rb
87
88
  - vagrant-powder.gemspec