1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00
rest-client--rest-client/lib/restclient/platform.rb
2014-04-25 16:14:56 -07:00

29 lines
677 B
Ruby

module RestClient
module Platform
# Return true if we are running on a darwin-based Ruby platform. This will
# be false for jruby even on OS X.
#
# @return [Boolean]
def self.mac?
RUBY_PLATFORM.include?('darwin')
end
# Return true if we are running on Windows.
#
# @return [Boolean]
#
def self.windows?
# Ruby only sets File::ALT_SEPARATOR on Windows, and the Ruby standard
# library uses that to test what platform it's on.
!!File::ALT_SEPARATOR
end
# Return true if we are running on jruby.
#
# @return [Boolean]
#
def self.jruby?
RUBY_PLATFORM == 'java'
end
end
end