features/support/env.rb in mirage-2.1.2 vs features/support/env.rb in mirage-2.2.2

- old
+ new

@@ -1,18 +1,24 @@ $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../lib") $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../../server") require 'rubygems' require 'mirage/client' -require 'util' require 'cucumber' require 'rspec' require 'mechanize' require 'childprocess' ENV['RUBYOPT'] ='' -include Mirage::Util +module OsSupport + def windows? + ENV['OS'] == 'Windows_NT' + end +end +World OsSupport +include OsSupport + SCRATCH = './scratch' RUBY_CMD = RUBY_PLATFORM == 'JAVA' ? 'jruby' : 'ruby' BLANK_RUBYOPT_CMD = windows? ? 'set RUBYOPT=' : "export RUBYOPT=''" @@ -21,10 +27,12 @@ MIRAGE_CMD = windows? ? `where mirage.bat`.chomp : 'mirage' else MIRAGE_CMD = "#{RUBY_CMD} ../bin/mirage" end + + module CommandLine COMAND_LINE_OUTPUT_PATH = "#{File.dirname(__FILE__)}/../../#{SCRATCH}/commandline_output.txt" module Windows def run command command = "#{MIRAGE_CMD} #{command.split(' ').drop(1).join(' ')}" if command =~ /^mirage/ @@ -64,12 +72,10 @@ end end module Mirage module Runner - include Mirage::Util - def stop_mirage system "cd #{SCRATCH} && #{MIRAGE_CMD} stop" end def start_mirage @@ -90,11 +96,9 @@ end module IntelliJ include CommandLine - include Mirage::Util - def run command execute "#{RUBY_CMD} #{command}" end end \ No newline at end of file