diff --git a/lib/vagrant/ssh.rb b/lib/vagrant/ssh.rb index c11324709..d36870c6d 100644 --- a/lib/vagrant/ssh.rb +++ b/lib/vagrant/ssh.rb @@ -1,6 +1,5 @@ require 'net/ssh' require 'net/scp' -require 'mario' module Vagrant # Manages SSH access to a specific environment. Allows an environment to @@ -27,7 +26,7 @@ module Vagrant # process with an SSH process. This method optionally takes a hash # of options which override the configuration values. def connect(opts={}) - if Mario::Platform.windows? + if Util::Platform.windows? raise Errors::SSHUnavailableWindows, :key_path => env.config.ssh.private_key_path, :ssh_port => port(opts) end @@ -137,7 +136,7 @@ module Vagrant # if needed, or on failure erroring. def check_key_permissions(key_path) # Windows systems don't have this issue - return if Mario::Platform.windows? + return if Util::Platform.windows? stat = File.stat(key_path) diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb index 4fb1b04bb..1b7cfc3f8 100644 --- a/lib/vagrant/ui.rb +++ b/lib/vagrant/ui.rb @@ -1,5 +1,3 @@ -require 'mario' - module Vagrant # Vagrant UIs handle communication with the outside world (typically # through a shell). They must respond to the typically logger methods @@ -61,7 +59,7 @@ module Vagrant def line_reset reset = "\r" - reset += "\e[0K" unless Mario::Platform.windows? + reset += "\e[0K" unless Util::Platform.windows? reset end end diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index 603abe61e..cbe3a3709 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -1,5 +1,4 @@ require 'rbconfig' -require 'mario' module Vagrant module Util @@ -53,7 +52,7 @@ module Vagrant def tar_file_options # create, write only, fail if the file exists, binary if windows - File::WRONLY|File::EXCL|File::CREAT|(Mario::Platform.windows? ? File::BINARY : 0) + File::WRONLY | File::EXCL | File::CREAT | (windows? ? File::BINARY : 0) end def platform diff --git a/test/test_helper.rb b/test/test_helper.rb index d98ec2ecb..c50dee490 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,7 +2,6 @@ $:.unshift(File.dirname(__FILE__)) require 'vagrant' -require 'mario' require 'contest' require 'mocha' @@ -14,9 +13,6 @@ begin rescue LoadError end -# Silence Mario by sending log output to black hole -Mario::Platform.logger(nil) - # Add the I18n locale for tests I18n.load_path << File.expand_path("../locales/en.yml", __FILE__) diff --git a/test/vagrant/ssh_test.rb b/test/vagrant/ssh_test.rb index 25ddd5eea..ecd700354 100644 --- a/test/vagrant/ssh_test.rb +++ b/test/vagrant/ssh_test.rb @@ -80,17 +80,13 @@ class SshTest < Test::Unit::TestCase end context "checking windows" do - teardown do - Mario::Platform.forced = Mario::Platform::Linux - end - should "error and exit if the platform is windows" do - Mario::Platform.forced = Mario::Platform::Windows7 + Vagrant::Util::Platform.stubs(:windows?).returns(true) assert_raises(Vagrant::Errors::SSHUnavailableWindows) { @ssh.connect } end should "not error and exit if the platform is anything other that windows" do - Mario::Platform.forced = Mario::Platform::Linux + Vagrant::Util::Platform.stubs(:windows?).returns(false) assert_nothing_raised { @ssh.connect } end end @@ -256,15 +252,11 @@ class SshTest < Test::Unit::TestCase @stat.stubs(:owned?).returns(true) File.stubs(:stat).returns(@stat) - Mario::Platform.forced = Mario::Platform::Linux - end - - teardown do - Mario::Platform.forced = Mario::Platform::Linux + Vagrant::Util::Platform.stubs(:windows?).returns(false) end should "do nothing if on windows" do - Mario::Platform.forced = Mario::Platform::Windows7 + Vagrant::Util::Platform.stubs(:windows?).returns(true) File.expects(:stat).never @ssh.check_key_permissions(@key_path) end diff --git a/test/vagrant/util/platform_test.rb b/test/vagrant/util/platform_test.rb index ab6789c97..8370cb234 100644 --- a/test/vagrant/util/platform_test.rb +++ b/test/vagrant/util/platform_test.rb @@ -6,12 +6,12 @@ class PlatformTest < Test::Unit::TestCase # This constant is not defined on non-windows platforms, so define it here File::BINARY = 4096 unless defined?(File::BINARY) - Mario::Platform.expects(:windows?).returns(true) + Vagrant::Util::Platform.stubs(:windows?).returns(true) assert_equal Vagrant::Util::Platform.tar_file_options, File::CREAT|File::EXCL|File::WRONLY|File::BINARY end should "not include binary bit on other platforms" do - Mario::Platform.expects(:windows?).returns(false) + Vagrant::Util::Platform.stubs(:windows?).returns(false) assert_equal Vagrant::Util::Platform.tar_file_options, File::CREAT|File::EXCL|File::WRONLY end end diff --git a/vagrant.gemspec b/vagrant.gemspec index d63e89c64..a58cd09be 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -17,7 +17,6 @@ Gem::Specification.new do |s| s.add_dependency "archive-tar-minitar", "= 0.5.2" s.add_dependency "erubis", "~> 2.7.0" s.add_dependency "json", "~> 1.5.1" - s.add_dependency "mario", "~> 0.0.6" s.add_dependency "net-ssh", "~> 2.1.4" s.add_dependency "net-scp", "~> 1.0.4" s.add_dependency "i18n", "~> 0.5.0"