Class: Lazylead::OS
- Inherits:
-
Object
- Object
- Lazylead::OS
- Defined in:
- lib/lazylead/os.rb
Overview
Represents a native, operation system.
- Author
-
Yurii Dubinka ([email protected])
- Copyright
-
Copyright © 2019-2020 Yurii Dubinka
- License
-
MIT
Instance Method Summary collapse
-
#run(*cmd) ⇒ Object
Run OS-oriented command.
Instance Method Details
#run(*cmd) ⇒ Object
TODO:
#/DEV Add support of multiline string literals, not just array of commands
Run OS-oriented command
49 50 51 52 53 54 |
# File 'lib/lazylead/os.rb', line 49 def run(*cmd) return "" if cmd.empty? || cmd.any?(&:nil?) todo = cmd todo = [cmd.first] if cmd.size == 1 `#{todo.join(" ")}`.scrub! end |