Rakefile in itamae-1.0.0.beta8 vs Rakefile in itamae-1.0.0.beta9

- old
+ new

@@ -1,10 +1,12 @@ require "bundler/gem_tasks" require 'rspec/core/rake_task' require 'tempfile' require 'net/ssh' +vagrant_bin = ENV['CI'] ? 'vagrant' : '/usr/bin/vagrant' + desc 'Run unit and integration specs.' task :spec => ['spec:unit', 'spec:integration:all'] namespace :spec do RSpec::Core::RakeTask.new("unit") do |task| @@ -13,11 +15,11 @@ end namespace :integration do targets = [] Bundler.with_clean_env do - `cd spec/integration && /usr/bin/vagrant status`.split("\n\n")[1].each_line do |line| + `cd spec/integration && #{vagrant_bin} status`.split("\n\n")[1].each_line do |line| targets << line.match(/^[^ ]+/)[0] end end task :all => targets @@ -29,12 +31,12 @@ namespace :provision do task target do Bundler.with_clean_env do config = Tempfile.new('', Dir.tmpdir) env = {"VAGRANT_CWD" => File.expand_path('./spec/integration')} - system env, "/usr/bin/vagrant up #{target}" - system env, "/usr/bin/vagrant ssh-config #{target} > #{config.path}" + system env, "#{vagrant_bin} up #{target}" + system env, "#{vagrant_bin} ssh-config #{target} > #{config.path}" options = Net::SSH::Config.for(target, [config.path]) cmd = "bundle exec bin/itamae ssh" cmd << " -h #{options[:host_name]}" cmd << " -u #{options[:user]}" @@ -73,5 +75,6 @@ end system "git add #{version_file}" system "git commit -m 'Bump up version'" end end +