File: platform.rb

package info (click to toggle)
ruby-cucumber-core 1.5.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 580 kB
  • sloc: ruby: 5,763; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 548 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Detect the platform we're running on so we can tweak behaviour
# in various places.
require 'rbconfig'

module Cucumber
  unless defined?(Cucumber::VERSION)
    JRUBY         = defined?(JRUBY_VERSION)
    IRONRUBY      = defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby"
    WINDOWS       = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
    OS_X          = RbConfig::CONFIG['host_os'] =~ /darwin/
    WINDOWS_MRI   = WINDOWS && !JRUBY && !IRONRUBY
    RUBY_2_0      = RUBY_VERSION =~ /^2\.0/
    RUBY_1_9      = RUBY_VERSION =~ /^1\.9/
  end
end