Class: DevSystem::Shell
- Inherits:
-
Liza::Controller
- Object
- Liza::Unit
- Liza::Controller
- DevSystem::Shell
- Defined in:
- lib/dev_system/subsystems/shell/shell.rb
Direct Known Subclasses
ArtSystem::DeepseekShell, ArtSystem::OllamaShell, ArtSystem::OpenaiShell, AppShell, ColorShell, ControllerShell, ConverterShell, EnvShell, ErbShell, FileShell, FormatterShell, GemShell, GemspecShell, InputShell, KernelShell, LineShell, MainShell, MethodShell, ObjectSpaceShell, PalletShell, RendererShell, SignalShell, SoftShell, TypographyShell, UnitShell, ViewShell, ZeitwerkShell, LabSystem::DockerInstallerShell, LabSystem::KrokiDockerShell
Instance Attribute Summary
Attributes inherited from Liza::Controller
Class Method Summary collapse
-
.all ⇒ Object
Returns all descendants of Shell.
-
.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
#`, `, 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
.all ⇒ Object
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
49 50 51 |
# File 'lib/dev_system/subsystems/shell/shell.rb', line 49 def self.cruby? @ruby || RUBY_ENGINE == "ruby" end |
.engine ⇒ Object
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
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
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
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 |
.os ⇒ Object
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_version ⇒ Object
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
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
9 10 11 |
# File 'lib/dev_system/subsystems/shell/shell.rb', line 9 def self.windows? @windows || Gem.win_platform? end |