Sha256: 09e338a0a448f9f954a88afbd52f4f0c3d64c4df6c5d4eb66bc851a1cfba8c0d
Contents?: true
Size: 924 Bytes
Versions: 69
Compression:
Stored size: 924 Bytes
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' require 'shellwords' module EacRubyUtils module Envs module BaseCommand class AppendCommandOptions enable_method_class common_constructor :command, :command_line, :options def result r = command_line r = input.command + ' | ' + r if input r = "cat #{Shellwords.escape(input_file)} | #{r}" if input_file r += ' > ' + Shellwords.escape(output_file) if output_file r end # @return [EacRubyUtils::Envs::Command, nil] def input options[:input] end # @return [Pathname, nil] def input_file options[:input_file].if_present(&:to_pathname) end # @return [Pathname, nil] def output_file options[:output_file].if_present(&:to_pathname) end end end end end
Version data entries
69 entries across 69 versions & 2 rubygems