Class: Pipewrench::Shell
- Inherits:
-
Object
- Object
- Pipewrench::Shell
- Includes:
- Enumerable
- Defined in:
- lib/pipewrench.rb
Instance Method Summary collapse
- #each(&blk) ⇒ Object
-
#initialize(stdin) ⇒ Shell
constructor
A new instance of Shell.
- #run(cmd) ⇒ Object
Constructor Details
#initialize(stdin) ⇒ Shell
Returns a new instance of Shell.
7 8 9 |
# File 'lib/pipewrench.rb', line 7 def initialize(stdin) @stdin = stdin end |
Instance Method Details
#each(&blk) ⇒ Object
15 16 17 |
# File 'lib/pipewrench.rb', line 15 def each(&blk) @stdin.each_line(&blk) end |
#run(cmd) ⇒ Object
11 12 13 |
# File 'lib/pipewrench.rb', line 11 def run(cmd) instance_eval(cmd) end |