Sha256: bbbb7069eaa73af8a12a330da5d427d6af1ab74a328070ca0008d82d33992984

Contents?: true

Size: 660 Bytes

Versions: 39

Compression:

Stored size: 660 Bytes

Contents

# frozen_string_literal: true

require 'eac_cli/runner'
require 'eac_ruby_utils/core_ext'
require 'eac_ruby_utils/abstract_methods'

module EacCli
  module RunnerWith
    module OutputFile
      common_concern do
        include ::EacCli::Runner
        include ::EacRubyUtils::AbstractMethods

        abstract_methods :output_content

        runner_definition do
          arg_opt '-o', '--output-file', 'Output to file.'
        end
      end

      def run_output
        if parsed.output_file.present?
          ::File.write(parsed.output_file, output_content)
        else
          $stdout.write(output_content)
        end
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 3 rubygems

Version Path
avm-tools-0.94.2 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
avm-tools-0.94.1 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
eac_cli-0.15.1 lib/eac_cli/runner_with/output_file.rb
eac_cli-0.15.0 lib/eac_cli/runner_with/output_file.rb
ehbrs-tools-0.20.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
avm-tools-0.94.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
eac_cli-0.14.0 lib/eac_cli/runner_with/output_file.rb
avm-tools-0.93.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
eac_cli-0.13.0 lib/eac_cli/runner_with/output_file.rb
avm-tools-0.92.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
avm-tools-0.91.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
avm-tools-0.90.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
avm-tools-0.89.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
avm-tools-0.88.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
eac_cli-0.12.6 lib/eac_cli/runner_with/output_file.rb
avm-tools-0.87.1 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
ehbrs-tools-0.19.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
ehbrs-tools-0.18.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
eac_cli-0.12.5 lib/eac_cli/runner_with/output_file.rb
avm-tools-0.87.0 vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb