1
0
Fork 0
mirror of https://github.com/ms-ati/docile synced 2023-03-27 23:21:52 -04:00
docile/on_what.rb

27 lines
491 B
Ruby
Raw Normal View History

# NOTE: Very simple tests for what system we are on, extracted for sharing
# between Rakefile, gemspec, and spec_helper. Not for use in actual library.
def on_travis?
2018-01-14 18:55:16 -05:00
ENV["CI"] == "true"
end
def on_jruby?
2018-01-14 18:55:16 -05:00
defined?(RUBY_ENGINE) && "jruby" == RUBY_ENGINE
end
2018-01-12 12:49:57 -05:00
def on_rubinius?
2018-01-14 18:55:16 -05:00
defined?(RUBY_ENGINE) && "rbx" == RUBY_ENGINE
2018-01-12 12:49:57 -05:00
end
def on_1_8?
2018-01-14 18:55:16 -05:00
RUBY_VERSION.start_with? "1.8"
end
def on_less_than_1_9_3?
2018-01-14 18:55:16 -05:00
RUBY_VERSION < "1.9.3"
end
def on_less_than_2_0?
2018-01-14 18:55:16 -05:00
RUBY_VERSION < "2.0.0"
end