Sha256: b2510d75c5f0c7c808e9085dbeea05c6bbaa7141cb706c1e6d45d264c50187c0

Contents?: true

Size: 338 Bytes

Versions: 1

Compression:

Stored size: 338 Bytes

Contents

# frozen_string_literal: true

module Nanoc::External
  class Filter < Nanoc::Filter
    identifier :external

    def run(content, params = {})
      cmd   = params.fetch(:exec)
      opts  = params.fetch(:options, [])

      command = TTY::Command.new(printer: :null)
      command.run(cmd, *opts, input: content).out
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nanoc-external-1.0.3 lib/nanoc/external/filter.rb