Class: DevSystem::Shell

Inherits:
Liza::Controller show all
Defined in:
lib/dev_system/subsystems/shell/shell.rb

Instance Attribute Summary

Attributes inherited from Liza::Controller

#menv

Class Method Summary collapse

Methods inherited from Liza::Controller

#`, `, attr_accessor, attr_reader, attr_writer, #attrs, box, #box, call, color, division, division!, division?, inherited, menv_accessor, menv_reader, menv_writer, on_connected, panel, #panel, plural, require, requirements, sh, #sh, singular, subsystem, subsystem!, subsystem?, subsystem_token, token

Methods inherited from Liza::Unit

_erbs_for, #add, add, cl, #cl, class_methods_defined, const_added, const_missing, constants_defined, define_error, descendants_select, division, erbs_available, erbs_defined, erbs_for, errors, #fetch, fetch, get, #get, instance_methods_defined, log, #log, log?, #log?, #log_array, log_array, log_hash, #log_hash, #log_level, log_level, #log_level?, log_level?, log_levels, #log_levels, #log_render_convert, #log_render_format, #log_render_in, #log_render_out, method_added, methods_defined, namespace, part, raise_error, #raise_error, reload!, #reload!, #render, #render!, #render_stack, renderable_formats_for, renderable_names, section, sections, #set, set, #settings, settings, singleton_method_added, sleep, #sleep, stick, #stick, sticks, #sticks, subclasses_select, subunits, system, #system, system?, test_class, time_diff, #time_diff

Class Method Details

.allObject

Returns all descendants of Shell



4
5
6
# File 'lib/dev_system/subsystems/shell/shell.rb', line 4

def self.all
  @all ||= AppShell.classes.select { _1 <= self }
end

.cruby?Boolean

Check if the current Ruby engine is MRI

Returns:

  • (Boolean)


49
50
51
# File 'lib/dev_system/subsystems/shell/shell.rb', line 49

def self.cruby?
  @ruby || RUBY_ENGINE == "ruby"
end

.engineObject

Return the current Ruby engine as a symbol



37
38
39
40
41
# File 'lib/dev_system/subsystems/shell/shell.rb', line 37

def self.engine
  return :jruby if jruby?
  return :cruby if cruby?
  :unknown
end

.jruby?Boolean

Check if the current Ruby engine is JRuby

Returns:

  • (Boolean)


44
45
46
# File 'lib/dev_system/subsystems/shell/shell.rb', line 44

def self.jruby?
  @jruby || RUBY_ENGINE == "jruby"
end

.linux?Boolean

Check if the current platform is Linux

Returns:

  • (Boolean)


19
20
21
# File 'lib/dev_system/subsystems/shell/shell.rb', line 19

def self.linux?
  @linux || (unix? && RbConfig::CONFIG['host_os'].include?("linux"))
end

.mac?Boolean

Check if the current platform is Mac OS

Returns:

  • (Boolean)


24
25
26
# File 'lib/dev_system/subsystems/shell/shell.rb', line 24

def self.mac?
  @mac || (unix? && RbConfig::CONFIG['host_os'].include?("darwin"))
end

.osObject

Return the current operating system as a symbol



29
30
31
32
33
34
# File 'lib/dev_system/subsystems/shell/shell.rb', line 29

def self.os
  return :windows if windows?
  return :linux   if linux?
  return :mac     if mac?
  :unix
end

.ruby_versionObject

Return the current Ruby version as a Gem::Version



54
55
56
# File 'lib/dev_system/subsystems/shell/shell.rb', line 54

def self.ruby_version
  Lizarb.ruby_version
end

.unix?Boolean

Check if the current platform is Unix or Unix-like

Returns:

  • (Boolean)


14
15
16
# File 'lib/dev_system/subsystems/shell/shell.rb', line 14

def self.unix?
  @unix || !windows?
end

.windows?Boolean

Check if the current platform is Windows

Returns:

  • (Boolean)


9
10
11
# File 'lib/dev_system/subsystems/shell/shell.rb', line 9

def self.windows?
  @windows || Gem.win_platform?
end