Vendorize vagrant

Closes #19
This commit is contained in:
Fabio Rehm 2013-03-02 20:36:06 -03:00
parent 4d6e5ea287
commit 61c4982fde
13 changed files with 41 additions and 52 deletions

4
.gitmodules vendored
View file

@ -1,3 +1,3 @@
[submodule "vagrant"] [submodule "vendor/vagrant"]
path = vagrant path = vendor/vagrant
url = git://github.com/mitchellh/vagrant.git url = git://github.com/mitchellh/vagrant.git

View file

@ -1,13 +1,7 @@
source 'https://rubygems.org' source 'https://rubygems.org'
unless ENV['USER'] == 'vagrant'
puts 'This Gemfile is meant to be used from the dev box'
exit 1
end
gemspec gemspec
gem 'vagrant', path: './vagrant'
gem 'rake' gem 'rake'
gem 'net-ssh' gem 'net-ssh'
gem 'rspec' gem 'rspec'

View file

@ -2,15 +2,10 @@ PATH
remote: . remote: .
specs: specs:
vagrant-lxc (0.0.1) vagrant-lxc (0.0.1)
PATH
remote: ./vagrant
specs:
vagrant (1.1.0.dev)
childprocess (~> 0.3.7) childprocess (~> 0.3.7)
erubis (~> 2.7.0) erubis (~> 2.7.0)
i18n (~> 0.6.0) i18n (~> 0.6.0)
json (~> 1.6.6) json (>= 1.5.1, < 1.8.0)
log4r (~> 1.1.9) log4r (~> 1.1.9)
net-scp (~> 1.0.4) net-scp (~> 1.0.4)
net-ssh (~> 2.2.2) net-ssh (~> 2.2.2)
@ -38,7 +33,7 @@ GEM
guard-rspec (2.4.1) guard-rspec (2.4.1)
guard (>= 1.1) guard (>= 1.1)
rspec (~> 2.11) rspec (~> 2.11)
i18n (0.6.2) i18n (0.6.3)
json (1.6.8) json (1.6.8)
listen (0.7.3) listen (0.7.3)
log4r (1.1.10) log4r (1.1.10)
@ -91,5 +86,4 @@ DEPENDENCIES
rspec-fire rspec-fire
rspec-spies rspec-spies
simplecov simplecov
vagrant!
vagrant-lxc! vagrant-lxc!

9
bin/vagrant-lxc Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env ruby
if File.exists?(File.join(File.expand_path('../../', __FILE__), '.git'))
$:.unshift(File.expand_path('../../lib', __FILE__))
end
require 'vagrant-lxc'
load Vagrant.source_root.join('bin/vagrant').to_s

View file

@ -5,5 +5,4 @@ end
source "https://rubygems.org" source "https://rubygems.org"
gem 'vagrant', path: '../vagrant'
gem 'vagrant-lxc', path: '../' gem 'vagrant-lxc', path: '../'

View file

@ -3,35 +3,12 @@ PATH
specs: specs:
vagrant-lxc (0.0.1) vagrant-lxc (0.0.1)
PATH
remote: ../vagrant
specs:
vagrant (1.1.0.dev)
childprocess (~> 0.3.7)
erubis (~> 2.7.0)
i18n (~> 0.6.0)
json (~> 1.6.6)
log4r (~> 1.1.9)
net-scp (~> 1.0.4)
net-ssh (~> 2.2.2)
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
childprocess (0.3.8)
ffi (~> 1.0, >= 1.0.11)
erubis (2.7.0)
ffi (1.4.0)
i18n (0.6.2)
json (1.6.8)
log4r (1.1.10)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-ssh (2.2.2)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
vagrant!
vagrant-lxc! vagrant-lxc!

View file

@ -1,10 +1,6 @@
require "vagrant-lxc/version" require "vendored_vagrant"
require "vagrant-lxc/version"
require "vagrant-lxc/plugin" require "vagrant-lxc/plugin"
I18n.load_path << File.expand_path(File.dirname(__FILE__) + '/../locales/en.yml') I18n.load_path << File.expand_path(File.dirname(__FILE__) + '/../locales/en.yml')
module Vagrant
module LXC
end
end

View file

@ -1,8 +1,9 @@
# FIXME: Ruby 1.8 users dont have SecureRandom # FIXME: Ruby 1.8 users dont have SecureRandom
require 'securerandom' require 'securerandom'
require 'vagrant/util/retryable' require "vendored_vagrant"
require 'vagrant/util/subprocess' require "vagrant/util/retryable"
require "vagrant/util/subprocess"
require "vagrant-lxc/errors" require "vagrant-lxc/errors"

9
lib/vendored_vagrant.rb Normal file
View file

@ -0,0 +1,9 @@
# Tks to: https://github.com/carlhuda/bundler/blob/master/lib/bundler/vendored_thor.rb
if defined?(Vagrant) && Vagrant.respond_to?(:in_installer?)
puts "vagrant has already been required. This may cause vagrant-lxc to malfunction in unexpected ways."
end
vendor = File.expand_path('../../vendor/vagrant/lib', __FILE__)
$:.unshift(vendor) unless $:.include?(vendor)
require 'vagrant'

View file

@ -7,9 +7,7 @@ if ENV['COVERAGE']
end end
end end
require 'bundler/setup' require 'bundler'
Bundler.require
require 'rspec-spies' require 'rspec-spies'

View file

@ -12,8 +12,19 @@ Gem::Specification.new do |gem|
gem.summary = %q{TODO: Write a gem summary} gem.summary = %q{TODO: Write a gem summary}
gem.homepage = "" gem.homepage = ""
gem.files = `git ls-files`.split($/) gem.files = `git ls-files`.split($/)
gem.files << `cd vendor/vagrant && git ls-files`.split($/).map{|file| "vendor/vagrant/#{file}"}
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ["lib"] gem.require_paths = ["lib"]
# Vagrant's dependencies
gem.add_dependency "childprocess", "~> 0.3.7"
gem.add_dependency "erubis", "~> 2.7.0"
gem.add_dependency "i18n", "~> 0.6.0"
gem.add_dependency "json", ">= 1.5.1", "< 1.8.0"
gem.add_dependency "log4r", "~> 1.1.9"
gem.add_dependency "net-ssh", "~> 2.2.2"
gem.add_dependency "net-scp", "~> 1.0.4"
end end

0
vendor/.gitkeep vendored Normal file
View file

1
vendor/vagrant vendored Submodule

@ -0,0 +1 @@
Subproject commit 0bb57fbe861de199293af22bf3111306ee37db70