Class: Germinate::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/germinate/process.rb

Overview

A Process represents an external command which can be used to process a Hunk of text.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, command) ⇒ Process

Returns a new instance of Process.



14
15
16
17
# File 'lib/germinate/process.rb', line 14

def initialize(name, command)
  @name    = name
  @command = command
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



10
11
12
# File 'lib/germinate/process.rb', line 10

def command
  @command
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/germinate/process.rb', line 9

def name
  @name
end

Instance Method Details

#call(input) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/germinate/process.rb', line 19

def call(input)
  if pipe?
    call_command_in_pipe(input)
  else
    call_command_on_temp_file(input)
  end
end