vagrant-localrsyncdeb 1.0.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5fbcab31d3888dd94c40df8f319055986ae44e95
4
+ data.tar.gz: 5c9456077bf5a12d7a2b7566116471aa9457203f
5
+ SHA512:
6
+ metadata.gz: feb70c1ed506542e5675dd43b2e5c1ccac5c4bc29115b297bea7602a911b6be02535d01c06f23f8bd158ff0e4b8974512d943a9bdbf55416e140247bd3f619e2
7
+ data.tar.gz: c6db1e374309af8e776e738b705179eb885aca44e769f73c6ca8191602495084af62c8f18913da732ee5ab0db1eef9fa593286d07896264aa9e2c336cb0e4348
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vagrant-localrsyncdeb.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
8
+ end
9
+
10
+ group :plugins do
11
+ gem "vagrant-localrsyncdeb", path: "."
12
+ end
@@ -0,0 +1,21 @@
1
+ # Vagrant-LocalRsyncDeb
2
+
3
+ Overrides the Debian rsync install capability to use an rsync.deb file in the vagrant project directory rather than using apt-get.
4
+
5
+ This means you can proceed to the provisioning stage on a vanilla Debian box without Internet access.
6
+
7
+ ## Installation
8
+
9
+ $ vagrant plugin install vagrant-localrsyncdeb
10
+
11
+ ## Usage
12
+
13
+ Obtain an rsync .deb file. You can do this by:
14
+
15
+ $ apt-get install rsync
16
+ $ ls /var/cache/apt/archives/rsync*.deb
17
+
18
+ Take a copy of the file you want, and place it in your vagrant project directory (alongside Vagrantfile). Name it rsync.deb (or symlink rsync.deb to the real file).
19
+
20
+ Voilà!
21
+
@@ -0,0 +1,5 @@
1
+ # require "bundler/gem_tasks"
2
+
3
+ require "rubygems"
4
+ require "bundler/setup"
5
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "vagrant/localrsyncdeb"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1 @@
1
+ require "vagrant-localrsyncdeb/plugin"
@@ -0,0 +1,25 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ raise "The Vagrant local rsync.deb plugin must be run within Vagrant."
5
+ end
6
+
7
+ module VagrantPlugins
8
+ module LocalRsyncDeb
9
+ class Plugin < Vagrant.plugin("2")
10
+
11
+ name "LocalRsyncDeb"
12
+
13
+ description <<-DESC
14
+ Overrides the Debian rsync_install capability to use an rsync.deb file in
15
+ the vagrant project directory rather than using apt-get.
16
+ DESC
17
+
18
+ guest_capability "debian", "rsync_install" do
19
+ require_relative "rsync_install"
20
+ RsyncInstall
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,35 @@
1
+ module VagrantPlugins
2
+ module LocalRsyncDeb
3
+
4
+ class RsyncInstall
5
+ def self.rsync_install(machine)
6
+ comms = machine.communicate
7
+ raise NotReady.new() unless comms.wait_for_ready(60)
8
+ raise NoFile.new() unless File.file?('rsync.deb')
9
+ begin
10
+ comms.upload("rsync.deb","/tmp/rsync.deb")
11
+ rescue
12
+ raise NoUpload.new()
13
+ end
14
+ raise NoInstall.new() unless comms.sudo("dpkg -i /tmp/rsync.deb") == 0
15
+ end
16
+ end
17
+
18
+ class NotReady < Vagrant::Errors::VagrantError
19
+ error_message("VM not ready for communication")
20
+ end
21
+
22
+ class NoFile < Vagrant::Errors::VagrantError
23
+ error_message("No local rsync.deb")
24
+ end
25
+
26
+ class NoUpload < Vagrant::Errors::VagrantError
27
+ error_message("Error uploading rsync.deb")
28
+ end
29
+
30
+ class NoInstall < Vagrant::Errors::VagrantError
31
+ error_message("Error installing rsync")
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module LocalRsyncDeb
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-localrsyncdeb/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-localrsyncdeb"
8
+ spec.version = VagrantPlugins::LocalRsyncDeb::VERSION
9
+ spec.platform = Gem::Platform::RUBY
10
+ spec.license = "MIT"
11
+ spec.authors = ["Ben Schmidt"]
12
+ spec.email = ["<insightful_schmidt@yahoo.com.au>"]
13
+ spec.summary = "Uses a local rsync.deb file instead of apt-get to install rsync on Debian"
14
+ spec.description = "Uses a local rsync.deb file instead of apt-get to install rsync on Debian"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.10"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ end
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-localrsyncdeb
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ben Schmidt
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-03-17 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.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
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.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Uses a local rsync.deb file instead of apt-get to install rsync on Debian
42
+ email:
43
+ - <insightful_schmidt@yahoo.com.au>
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - .travis.yml
50
+ - Gemfile
51
+ - README.md
52
+ - Rakefile
53
+ - bin/console
54
+ - bin/setup
55
+ - lib/vagrant-localrsyncdeb.rb
56
+ - lib/vagrant-localrsyncdeb/plugin.rb
57
+ - lib/vagrant-localrsyncdeb/rsync_install.rb
58
+ - lib/vagrant-localrsyncdeb/version.rb
59
+ - vagrant-localrsyncdeb.gemspec
60
+ homepage:
61
+ licenses:
62
+ - MIT
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.6.2
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: Uses a local rsync.deb file instead of apt-get to install rsync on Debian
84
+ test_files: []