Class: Germinate::ShellPublisher
- Defined in:
- lib/germinate/shell_publisher.rb
Instance Method Summary collapse
-
#initialize(name, librarian, options) ⇒ ShellPublisher
constructor
A new instance of ShellPublisher.
- #publish!(output, extra_options = {}) ⇒ Object
Methods inherited from Publisher
identifier, #input, make, register_publisher_type
Constructor Details
#initialize(name, librarian, options) ⇒ ShellPublisher
Returns a new instance of ShellPublisher.
4 5 6 7 8 9 10 |
# File 'lib/germinate/shell_publisher.rb', line 4 def initialize(name, librarian, ) @command = .delete(:command) do raise ArgumentError, "A 'command' option must be supplied for publisher type 'shell'" end super end |
Instance Method Details
#publish!(output, extra_options = {}) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/germinate/shell_publisher.rb', line 12 def publish!(output, ={}) process = Germinate::ShellProcess.new(name, @command, librarian.variables) processed = process.call(input) processed.each do |line| output.print(line) end end |