vagrant-powder 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e58e1d4657ac40cc7d397c20a69d09ba39896775
4
+ data.tar.gz: 43c5429cff974d57dbfae7edd0179085d26cf93d
5
+ SHA512:
6
+ metadata.gz: 83cf347cac6ae0c73338016bc2bc39871f4c0ebdfc7e83151f1cfbce91a1b6d1cda44880265e59f86e7b83160f861baf7d7591174788396de7044af7dd29832e
7
+ data.tar.gz: b7be00435bc7f9e42c70e49df9d78c6dd56a4b0fc300b7f5508bce1b1251ba51377560fa196e0928914a22ac77142116f38aa777f680a3f8f4b1db8097177927
data/.gitignore ADDED
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ .vagrant
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # gemspec
4
+
5
+ gem 'powder'
6
+
7
+ group :development do
8
+ gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
9
+ end
10
+
11
+ group :plugins do
12
+ gem "vagrant-powder", path: "."
13
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Joe Kratzat
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # VagrantPowder
2
+
3
+ A [Vagrant](http://www.vagrantup.com/) plugin to help with
4
+ [POW](http://pow.cx/) using the
5
+ [Powder Gem](https://github.com/Rodreegez/powder).
6
+
7
+ ## Requirements
8
+
9
+ * Vagrant version 1.2.0 or greater.
10
+ * OSX
11
+ * [pow](http://pow.cx/)
12
+
13
+ ## Installation
14
+
15
+ TODO: distribute to plugin repo so the following works
16
+
17
+ ``` bash
18
+ vagrant plugin install vagrant-powder
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ Vagrant will automatically run `powder down`
24
+ after any `vagrant up` step.
25
+
26
+ You can also manually run
27
+ ``` bash
28
+ vagrant powder-down
29
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/Vagrantfile ADDED
@@ -0,0 +1,4 @@
1
+ Vagrant.configure("2") do |config|
2
+ config.vm.box = "hashicorp/precise64"
3
+ config.vm.box_url = "http://files.vagrantup.com/precise64.box"
4
+ end
@@ -0,0 +1,7 @@
1
+ require "vagrant-powder/version"
2
+ require "vagrant-powder/plugin"
3
+
4
+ module VagrantPlugins
5
+ module VagrantPowder
6
+ end
7
+ end
@@ -0,0 +1,34 @@
1
+
2
+ module VagrantPlugins
3
+ module Powder
4
+ class Action
5
+
6
+ def initialize(app,env)
7
+ @app = app
8
+ @ui = env[:ui]
9
+ @machine = env[:machine].name.to_s
10
+ @machinfo = env[:machine]
11
+ end
12
+
13
+ def call(env)
14
+ # Before machine action
15
+ state = env[:machine].state.id
16
+
17
+ # Execute machine action
18
+ @app.call(env)
19
+
20
+ # After execute machine action
21
+ config = env[:machine].config.Pushbullet
22
+ action = env[:machine_action]
23
+ provision = env[:provision_enabled]
24
+
25
+ case action
26
+ when :up
27
+ puts "Powder down"
28
+ `powder down`
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,18 @@
1
+ module VagrantPlugins
2
+ module Powder
3
+
4
+ class Command < Vagrant.plugin(2, :command)
5
+
6
+ def self.synopsis
7
+ "runs powder down so you don't have to."
8
+ end
9
+
10
+ def execute
11
+ puts "Running 'powder down'"
12
+ `powder down`
13
+ 0
14
+ end
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,40 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ raise "The Vagrant Powder plugin must be run within Vagrant."
5
+ end
6
+
7
+ module VagrantPlugins
8
+ module Powder
9
+
10
+ class Plugin < Vagrant.plugin("2")
11
+ name "Powder"
12
+ description <<-DESC
13
+ This plugin handles powder on 'up' and 'down'
14
+ DESC
15
+
16
+ command "powder-down" do
17
+ require_relative "command"
18
+ Command
19
+ end
20
+
21
+ action_hook("Powder_hook", :machine_action_up) do |hook|
22
+ require_relative "action"
23
+ hook.prepend(Action)
24
+ end
25
+
26
+ # TODO: Handle powder up on halt and destroy
27
+ # action_hook("Powder_hook", :machine_action_halt) do |hook|
28
+ # require_relative "action"
29
+ # hook.prepend(Action)
30
+ # end
31
+ #
32
+ # action_hook("Powder_hook", :machine_action_destroy) do |hook|
33
+ # require_relative "action"
34
+ # hook.prepend(Action)
35
+ # end
36
+
37
+ end
38
+
39
+ end
40
+ end
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module Powder
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-powder/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-powder"
8
+ spec.version = VagrantPlugins::Powder::VERSION
9
+ spec.authors = ["Joe Kratzat"]
10
+ spec.email = ["joe.kratzat@gmail.com"]
11
+ spec.summary = %q{Allows vagrant to handle the powder gem}
12
+ spec.description = %q{Makes sure that pow isn't running when you vagrant up}
13
+ spec.homepage = "https://github.com/joekr/vagrant-powder"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake", '~> 10.1', '>= 10.1.1'
23
+
24
+ spec.add_runtime_dependency "powder", '~> 0.2', '>= 0.2.1'
25
+ end
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-powder
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Joe Kratzat
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.1'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 10.1.1
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '10.1'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 10.1.1
47
+ - !ruby/object:Gem::Dependency
48
+ name: powder
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '0.2'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 0.2.1
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '0.2'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 0.2.1
67
+ description: Makes sure that pow isn't running when you vagrant up
68
+ email:
69
+ - joe.kratzat@gmail.com
70
+ executables: []
71
+ extensions: []
72
+ extra_rdoc_files: []
73
+ files:
74
+ - ".gitignore"
75
+ - Gemfile
76
+ - LICENSE.txt
77
+ - README.md
78
+ - Rakefile
79
+ - Vagrantfile
80
+ - lib/vagrant-powder.rb
81
+ - lib/vagrant-powder/action.rb
82
+ - lib/vagrant-powder/command.rb
83
+ - lib/vagrant-powder/plugin.rb
84
+ - lib/vagrant-powder/version.rb
85
+ - vagrant-powder.gemspec
86
+ homepage: https://github.com/joekr/vagrant-powder
87
+ licenses:
88
+ - MIT
89
+ metadata: {}
90
+ post_install_message:
91
+ rdoc_options: []
92
+ require_paths:
93
+ - lib
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ requirements: []
105
+ rubyforge_project:
106
+ rubygems_version: 2.2.2
107
+ signing_key:
108
+ specification_version: 4
109
+ summary: Allows vagrant to handle the powder gem
110
+ test_files: []