Class: Perfume::Shell::Base
- Inherits:
-
Object
- Object
- Perfume::Shell::Base
- Defined in:
- lib/perfume/shell/base.rb
Overview
Internal: Executing shell commands isn’t good practice. Especially it’s bad when calling ruby methods like ‘exec` or `system`. This is dangerous and completely untestable. So here it comes base wrapper around shell calls.
Check Perfume::Shell::Exec and Perfume::Shell:SystemCall for two most common use cases.
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#before ⇒ Object
24 25 |
# File 'lib/perfume/shell/base.rb', line 24 def before end |
#defaults ⇒ Object
20 21 22 |
# File 'lib/perfume/shell/base.rb', line 20 def defaults { root: Dir.pwd } end |
#init ⇒ Object
12 13 14 |
# File 'lib/perfume/shell/base.rb', line 12 def init @root = Pathname.new(@root) end |
#log ⇒ Object
16 17 18 |
# File 'lib/perfume/shell/base.rb', line 16 def log @log or self.class.log end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/perfume/shell/base.rb', line 27 def to_s cmd.to_s end |