vagrant-reload 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ec8648c2a05301f655c0eb9fc2923cce084de1b2
4
+ data.tar.gz: 8d5849ff67fe32e528a7ea9c56ba360741996af5
5
+ SHA512:
6
+ metadata.gz: e14a45c5fb6fdbf703fc7d6af52f924d65a1d17452874464be0c019ba32a67660366ca7691931b0c00ecd55999b321b368a117eb8ee0b5477a584f7644995ca9
7
+ data.tar.gz: 5ce87716bfac6640ffabf5a3864d85e33ffdc8c8535bcfe6b95180e5deadba6cadeaaaca18a2fdc4a3ff7250c10942adeeb6e421d9317e41838ae5a5d615e303
@@ -0,0 +1,13 @@
1
+ # OS-specific
2
+ .DS_Store
3
+
4
+ # Bundler/Rubygems
5
+ *.gem
6
+ .bundle
7
+ pkg/*
8
+ tags
9
+ Gemfile.lock
10
+
11
+ # Vagrant
12
+ .vagrant
13
+ Vagrantfile
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ # We depend on Vagrant for development, but we don't add it as a
7
+ # gem dependency because we expect to be installed within the
8
+ # Vagrant environment itself using `vagrant plugin`.
9
+ gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git", :tag => "v1.3.4"
10
+ end
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Aidan Nagorcka-Smith
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.
@@ -0,0 +1,39 @@
1
+ # Vagrant Reload Provisioner
2
+
3
+ This is a Vagrant 1.2+ plugin that adds a `reload` provisioning step that can
4
+ be used to do a reload on a VM during provisioning.
5
+
6
+ # Installation
7
+
8
+ `$ vagrant plugin install vagrant-reload`
9
+
10
+ ## Usage
11
+
12
+ Add `config.vm.provision :reload` to your `Vagrantfile` to reload your VM
13
+ during provisioning.
14
+
15
+ ## Development
16
+
17
+ To work on the `vagrant-reload` plugin, clone this repository out, and use
18
+ [Bundler](http://gembundler.com) to get the dependencies:
19
+
20
+ $ bundle
21
+
22
+ You can test the plugin without installing it into your Vagrant environment by
23
+ just creating a `Vagrantfile` in the top level of this directory
24
+ (it is gitignored) and add the following line to your `Vagrantfile`
25
+
26
+ ```ruby
27
+ Vagrant.require_plugin "vagrant-reload"
28
+ ```
29
+ Use bundler to execute Vagrant:
30
+
31
+ $ bundle exec vagrant up
32
+
33
+ ## Contributing
34
+
35
+ 1. Fork it
36
+ 2. Create your feature branch (`$ git checkout -b my-new-feature`)
37
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
38
+ 4. Push to the branch (`git push origin my-new-feature`)
39
+ 5. Create new Pull Request
@@ -0,0 +1,9 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ # This installs the tasks that help with gem creation and
5
+ # publishing.
6
+ Bundler::GemHelper.install_tasks
7
+
8
+ # Default task is to run the unit tests
9
+ task :default => "build"
@@ -0,0 +1,53 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ raise "The Vagrant AWS plugin must be run within Vagrant."
5
+ end
6
+
7
+ # This is a sanity check to make sure no one is attempting to install
8
+ # this into an early Vagrant version.
9
+ if Vagrant::VERSION < "1.2.0"
10
+ raise "The Vagrant Reload plugin is only compatible with Vagrant 1.2+"
11
+ end
12
+
13
+ module VagrantPlugins
14
+ module Reload
15
+
16
+ VERSION = "0.0.1"
17
+
18
+ class Plugin < Vagrant.plugin("2")
19
+ name "Reload"
20
+ description <<-DESC
21
+ The reload plugin allows a VM to be reloaded as a provisioning step.
22
+ DESC
23
+
24
+ provisioner "reload" do
25
+ class ReloadProvisioner < Vagrant.plugin("2", :provisioner)
26
+
27
+ def initialize(machine, config)
28
+ super
29
+ end
30
+
31
+ def configure(root_config)
32
+ end
33
+
34
+ def provision
35
+ options = {}
36
+ options[:provision_ignore_sentinel] = false
37
+ @machine.action(:reload, options)
38
+ begin
39
+ sleep 10
40
+ end until @machine.communicate.ready?
41
+ end
42
+
43
+ def cleanup
44
+ end
45
+
46
+ end
47
+ ReloadProvisioner
48
+
49
+ end
50
+ end
51
+ end
52
+ end
53
+
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module Reload
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,53 @@
1
+ # Add the lib directory to the load path so we can get the version file out.
2
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
3
+
4
+ require 'vagrant-reload/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "vagrant-reload"
8
+ gem.version = VagrantPlugins::Reload::VERSION
9
+ gem.platform = Gem::Platform::RUBY
10
+ gem.license = "MIT"
11
+ gem.authors = "Aidan Nagorcka-Smith"
12
+ gem.email = "aidanns@gmail.com"
13
+ gem.homepage = "http://www.vagrantup.com"
14
+ gem.description = "Enables reloading a vagrant VM as a provisioning step."
15
+ gem.summary = "Enables reloading a vagrant VM as a provisioning step."
16
+
17
+ gem.add_development_dependency "rake"
18
+
19
+ # The following block of code determines the files that should be included
20
+ # in the gem. It does this by reading all the files in the directory where
21
+ # this gemspec is, and parsing out the ignored files from the gitignore.
22
+ # Note that the entire gitignore(5) syntax is not supported, specifically
23
+ # the "!" syntax, but it should mostly work correctly.
24
+ root_path = File.dirname(__FILE__)
25
+ all_files = Dir.chdir(root_path) { Dir.glob("**/{*,.*}") }
26
+ all_files.reject! { |file| [".", ".."].include?(File.basename(file)) }
27
+ gitignore_path = File.join(root_path, ".gitignore")
28
+ gitignore = File.readlines(gitignore_path)
29
+ gitignore.map! { |line| line.chomp.strip }
30
+ gitignore.reject! { |line| line.empty? || line =~ /^(#|!)/ }
31
+
32
+ unignored_files = all_files.reject do |file|
33
+ # Ignore any directories, the gemspec only cares about files
34
+ next true if File.directory?(file)
35
+
36
+ # Ignore any paths that match anything in the gitignore. We do
37
+ # two tests here:
38
+ #
39
+ # - First, test to see if the entire path matches the gitignore.
40
+ # - Second, match if the basename does, this makes it so that things
41
+ # like '.DS_Store' will match sub-directories too (same behavior
42
+ # as git).
43
+ #
44
+ gitignore.any? do |ignore|
45
+ File.fnmatch(ignore, file, File::FNM_PATHNAME) ||
46
+ File.fnmatch(ignore, File.basename(file), File::FNM_PATHNAME)
47
+ end
48
+ end
49
+
50
+ gem.files = unignored_files
51
+ gem.executables = unignored_files.map { |f| f[/^bin\/(.*)/, 1] }.compact
52
+ gem.require_path = 'lib'
53
+ end
metadata ADDED
@@ -0,0 +1,65 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-reload
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Aidan Nagorcka-Smith
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-10-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Enables reloading a vagrant VM as a provisioning step.
28
+ email: aidanns@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - Gemfile
34
+ - lib/vagrant-reload/version.rb
35
+ - lib/vagrant-reload.rb
36
+ - LICENSE.txt
37
+ - Rakefile
38
+ - README.md
39
+ - vagrant-reload.gemspec
40
+ - .gitignore
41
+ homepage: http://www.vagrantup.com
42
+ licenses:
43
+ - MIT
44
+ metadata: {}
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ requirements: []
60
+ rubyforge_project:
61
+ rubygems_version: 2.0.7
62
+ signing_key:
63
+ specification_version: 4
64
+ summary: Enables reloading a vagrant VM as a provisioning step.
65
+ test_files: []