Class: ShellBuffer

Inherits:
ShellContext show all
Defined in:
lib/cabeza-de-termo/cachivache-helpers/utilities/shell-contexts/shell_buffer.rb

Instance Method Summary collapse

Methods inherited from ShellContext

current, during_shell_context, #raise_validation_error, #remind_to, reminders, set_current, show_info, #show_info

Constructor Details

#initialize(underlaying_shell_context) ⇒ ShellBuffer

Returns a new instance of ShellBuffer.



4
5
6
7
# File 'lib/cabeza-de-termo/cachivache-helpers/utilities/shell-contexts/shell_buffer.rb', line 4

def initialize(underlaying_shell_context)
	@underlaying_shell_context = underlaying_shell_context
	@contents = ''
end

Instance Method Details

#contentsObject



13
14
15
# File 'lib/cabeza-de-termo/cachivache-helpers/utilities/shell-contexts/shell_buffer.rb', line 13

def contents
	@contents
end

#execute(task_name, *args) ⇒ Object



30
31
32
# File 'lib/cabeza-de-termo/cachivache-helpers/utilities/shell-contexts/shell_buffer.rb', line 30

def execute(task_name, *args)
	underlaying_shell_context.execute(task_name, *args)
end

#invoke(task_name, *args) ⇒ Object



26
27
28
# File 'lib/cabeza-de-termo/cachivache-helpers/utilities/shell-contexts/shell_buffer.rb', line 26

def invoke(task_name, *args)
	underlaying_shell_context.invoke(task_name, *args)
end

#shell(command) ⇒ Object



17
18
19
20
# File 'lib/cabeza-de-termo/cachivache-helpers/utilities/shell-contexts/shell_buffer.rb', line 17

def shell(command)
	contents << "\n" unless contents.empty?
	contents << command
end

#shell!(command) ⇒ Object



22
23
24
# File 'lib/cabeza-de-termo/cachivache-helpers/utilities/shell-contexts/shell_buffer.rb', line 22

def shell!(command)
	underlaying_shell_context.shell! command
end

#underlaying_shell_contextObject



9
10
11
# File 'lib/cabeza-de-termo/cachivache-helpers/utilities/shell-contexts/shell_buffer.rb', line 9

def underlaying_shell_context()
	@underlaying_shell_context
end