Module: Running
- Defined in:
- lib/running.rb
Constant Summary collapse
- WINDOWS =
RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
Class Method Summary collapse
- .from_the_police? ⇒ Boolean
- .jruby? ⇒ Boolean
- .maglev? ⇒ Boolean
- .mingw? ⇒ Boolean
- .mingw_18? ⇒ Boolean
- .mingw_19? ⇒ Boolean
- .mingw_20? ⇒ Boolean
- .mri? ⇒ Boolean
- .mri_18? ⇒ Boolean
- .mri_19? ⇒ Boolean
- .mswin? ⇒ Boolean
- .rbx? ⇒ Boolean
- .ruby? ⇒ Boolean
- .ruby_18? ⇒ Boolean
- .ruby_19? ⇒ Boolean
- .ruby_20? ⇒ Boolean
Class Method Details
.from_the_police? ⇒ Boolean
66 67 68 |
# File 'lib/running.rb', line 66 def from_the_police? true end |
.jruby? ⇒ Boolean
42 43 44 |
# File 'lib/running.rb', line 42 def jruby? !defined?(RUBY_ENGINE).nil? && RUBY_ENGINE == "jruby" end |
.maglev? ⇒ Boolean
38 39 40 |
# File 'lib/running.rb', line 38 def maglev? ruby? && !defined?(RUBY_ENGINE).nil? && RUBY_ENGINE == "maglev" end |
.mingw? ⇒ Boolean
50 51 52 |
# File 'lib/running.rb', line 50 def mingw? !WINDOWS.nil? && Gem::Platform.local.os == "mingw32" end |
.mingw_18? ⇒ Boolean
54 55 56 |
# File 'lib/running.rb', line 54 def mingw_18? mingw? && ruby_version_matches(1.8) end |
.mingw_19? ⇒ Boolean
58 59 60 |
# File 'lib/running.rb', line 58 def mingw_19? mingw? && ruby_version_matches(1.9) end |
.mingw_20? ⇒ Boolean
62 63 64 |
# File 'lib/running.rb', line 62 def mingw_20? mingw? && ruby_version_matches(2.0) end |
.mri? ⇒ Boolean
22 23 24 |
# File 'lib/running.rb', line 22 def mri? !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") end |
.mri_18? ⇒ Boolean
26 27 28 |
# File 'lib/running.rb', line 26 def mri_18? mri? && ruby_version_matches(1.8) end |
.mri_19? ⇒ Boolean
30 31 32 |
# File 'lib/running.rb', line 30 def mri_19? mri? && ruby_version_matches(1.9) end |
.rbx? ⇒ Boolean
34 35 36 |
# File 'lib/running.rb', line 34 def rbx? ruby? && !defined?(RUBY_ENGINE).nil? && RUBY_ENGINE == "rbx" end |
.ruby? ⇒ Boolean
6 7 8 |
# File 'lib/running.rb', line 6 def ruby? !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev") end |
.ruby_18? ⇒ Boolean
10 11 12 |
# File 'lib/running.rb', line 10 def ruby_18? ruby? && ruby_version_matches(1.8) end |
.ruby_19? ⇒ Boolean
14 15 16 |
# File 'lib/running.rb', line 14 def ruby_19? ruby? && ruby_version_matches(1.9) end |
.ruby_20? ⇒ Boolean
18 19 20 |
# File 'lib/running.rb', line 18 def ruby_20? ruby? && ruby_version_matches(2.0) end |