Class: DevSystem::Shell
- Inherits:
-
Liza::Controller
- Object
- Liza::Unit
- Liza::Controller
- DevSystem::Shell
- Defined in:
- lib/dev_system/sub/shell/shell.rb
Direct Known Subclasses
AppShell, ColorShell, ControllerShell, ConverterShell, FileShell, FormatterShell, GemShell, KernelShell, LineDiffShell, LineShell, MethodShell, LabSystem::DockerShell
Class Method Summary collapse
-
.cruby? ⇒ Boolean
Check if the current Ruby engine is MRI.
-
.engine ⇒ Object
Return the current Ruby engine as a symbol.
-
.jruby? ⇒ Boolean
Check if the current Ruby engine is JRuby.
-
.linux? ⇒ Boolean
Check if the current platform is Linux.
-
.mac? ⇒ Boolean
Check if the current platform is Mac OS.
-
.os ⇒ Object
Return the current operating system as a symbol.
-
.ruby_version ⇒ Object
Return the current Ruby version as a Gem::Version.
-
.unix? ⇒ Boolean
Check if the current platform is Unix or Unix-like.
-
.windows? ⇒ Boolean
Check if the current platform is Windows.
Methods inherited from Liza::Controller
color, inherited, on_connected
Methods inherited from Liza::Unit
const_missing, division, part, system, #system, test_class
Class Method Details
.cruby? ⇒ Boolean
Check if the current Ruby engine is MRI
44 45 46 |
# File 'lib/dev_system/sub/shell/shell.rb', line 44 def self.cruby? @ruby || RUBY_ENGINE == "ruby" end |
.engine ⇒ Object
Return the current Ruby engine as a symbol
32 33 34 35 36 |
# File 'lib/dev_system/sub/shell/shell.rb', line 32 def self.engine return :jruby if jruby? return :cruby if cruby? :unknown end |
.jruby? ⇒ Boolean
Check if the current Ruby engine is JRuby
39 40 41 |
# File 'lib/dev_system/sub/shell/shell.rb', line 39 def self.jruby? @jruby || RUBY_ENGINE == "jruby" end |
.linux? ⇒ Boolean
Check if the current platform is Linux
14 15 16 |
# File 'lib/dev_system/sub/shell/shell.rb', line 14 def self.linux? @linux || (unix? && RbConfig::CONFIG['host_os'].include?("linux")) end |
.mac? ⇒ Boolean
Check if the current platform is Mac OS
19 20 21 |
# File 'lib/dev_system/sub/shell/shell.rb', line 19 def self.mac? @mac || (unix? && RbConfig::CONFIG['host_os'].include?("darwin")) end |
.os ⇒ Object
Return the current operating system as a symbol
24 25 26 27 28 29 |
# File 'lib/dev_system/sub/shell/shell.rb', line 24 def self.os return :windows if windows? return :linux if linux? return :mac if mac? :unix end |
.ruby_version ⇒ Object
Return the current Ruby version as a Gem::Version
49 50 51 |
# File 'lib/dev_system/sub/shell/shell.rb', line 49 def self.ruby_version Lizarb.ruby_version end |
.unix? ⇒ Boolean
Check if the current platform is Unix or Unix-like
9 10 11 |
# File 'lib/dev_system/sub/shell/shell.rb', line 9 def self.unix? @unix || !windows? end |
.windows? ⇒ Boolean
Check if the current platform is Windows
4 5 6 |
# File 'lib/dev_system/sub/shell/shell.rb', line 4 def self.windows? @windows || Gem.win_platform? end |