Sha256: 753a811ad26f53bc4efe561ea3f0af06e2553dfefca5510a7d3cf51dc3bfef6b

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

class Germinate::ShellPublisher < Germinate::Publisher
  identifier 'shell'

  def initialize(name, librarian, options)
    @command = options.delete(:command) do
      raise ArgumentError, 
            "A 'command' option must be supplied for publisher type 'shell'"
    end
    super
  end

  def publish!(output, extra_options={})
    process = Germinate::ShellProcess.new(name, @command, librarian.variables)
    processed = process.call(input)
    processed.each do |line|
      output.print(line)
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
devver-germinate-1.2.0 lib/germinate/shell_publisher.rb
germinate-1.2.0 lib/germinate/shell_publisher.rb