module Travis::Tools::System

def description(*args)

def description(*args)
  [ os, ruby, rubygems, *args.flatten].compact.uniq.join("; ")
end

def linux?

def linux?
  RUBY_PLATFORM =~ /linux/i
end

def mac?

def mac?
  RUBY_PLATFORM =~ /darwin/i
end

def os

def os
  @os ||= windows? ? "Windows" : `uname`.chomp
end

def ruby

def ruby
  case ruby_engine
  when 'ruby'  then "Ruby #{ruby_version}"
  when 'jruby' then "JRuby #{JRUBY_VERSION} like Ruby #{ruby_version}"
  when 'rbx'   then "Rubinius #{Rubinius.version[/\d\S+/]} like Ruby #{ruby_version}"
  else              "#{ruby_engine} like Ruby #{ruby_version}"
  end
end

def ruby_engine

def ruby_engine
  defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
end

def ruby_version

def ruby_version
  "%s-p%s" % [RUBY_VERSION, RUBY_PATCHLEVEL]
end

def rubygems

def rubygems
  return "no RubyGems" unless defined? Gem
  "RubyGems #{Gem::VERSION}"
end

def windows?

def windows?
  File::ALT_SEPARATOR == "\\"
end