module Minitest::Guard

def jruby? platform = RUBY_PLATFORM

def jruby? platform = RUBY_PLATFORM
  "java" == platform
end

def maglev? platform = defined?(RUBY_ENGINE) && RUBY_ENGINE

def maglev? platform = defined?(RUBY_ENGINE) && RUBY_ENGINE
  where = Minitest.filter_backtrace(caller).first
  where = where.split(/:in /, 2).first # clean up noise
  warn "DEPRECATED: `maglev?` called from #{where}. This will fail in Minitest 6."
  "maglev" == platform
end

def mri? platform = RUBY_DESCRIPTION

def mri? platform = RUBY_DESCRIPTION
  /^ruby/ =~ platform
end

def osx? platform = RUBY_PLATFORM

def osx? platform = RUBY_PLATFORM
  /darwin/ =~ platform
end

def rubinius? platform = defined?(RUBY_ENGINE) && RUBY_ENGINE

def rubinius? platform = defined?(RUBY_ENGINE) && RUBY_ENGINE
  where = Minitest.filter_backtrace(caller).first
  where = where.split(/:in /, 2).first # clean up noise
  warn "DEPRECATED: `rubinius?` called from #{where}. This will fail in Minitest 6."
  "rbx" == platform
end

def windows? platform = RUBY_PLATFORM

def windows? platform = RUBY_PLATFORM
  /mswin|mingw/ =~ platform
end