Class: DevSystem::KernelShell
- Inherits:
-
Shell
- Object
- Liza::Unit
- Liza::Controller
- Shell
- DevSystem::KernelShell
- Defined in:
- lib/dev_system/sub/shell/shells/kernel_shell.rb
Class Method Summary collapse
- .call_backticks(command, log_level: :lower) ⇒ Object
- .call_system(command, log_level: :normal) ⇒ Object
Methods inherited from Shell
cruby?, engine, jruby?, linux?, mac?, os, ruby_version, unix?, 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
.call_backticks(command, log_level: :lower) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/dev_system/sub/shell/shells/kernel_shell.rb', line 5 def self.call_backticks(command, log_level: :lower) log log_level, "#{stick command, DevSystem.color} | executing and outputting result" result = `#{command}` puts result if log? log_level result end |
.call_system(command, log_level: :normal) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/dev_system/sub/shell/shells/kernel_shell.rb', line 14 def self.call_system(command, log_level: :normal) log log_level, "#{command} | executing" success = Kernel.system(command) = success ? (stick :green, "successfully") : (stick :red, "failed") log log_level, "Command executed #{}" success end |