Class: Rubsh::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/rubsh/shell.rb,
lib/rubsh/shell/env.rb

Defined Under Namespace

Classes: Env

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeShell

Returns a new instance of Shell.



7
8
9
# File 'lib/rubsh/shell.rb', line 7

def initialize
  @env = Env.new
end

Instance Attribute Details

#envEnv (readonly)

Returns:



5
6
7
# File 'lib/rubsh/shell.rb', line 5

def env
  @env
end

Instance Method Details

#command(prog) ⇒ Command Also known as: cmd

Returns:



12
13
14
# File 'lib/rubsh/shell.rb', line 12

def command(prog)
  Command.new(self, prog)
end

#pipeline(**kwarg) ⇒ RunningPipeline

Returns:



18
19
20
21
22
# File 'lib/rubsh/shell.rb', line 18

def pipeline(**kwarg)
  r = RunningPipeline.new(self).tap { |x| yield x }
  r.__run(**kwarg)
  r
end