Sha256: 9d1335a8800e5ebfc58c91a11ec32e8270a15570bc293f1f85937b722913a23c

Contents?: true

Size: 713 Bytes

Versions: 38

Compression:

Stored size: 713 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/envs'
require 'eac_ruby_utils/simple_cache'

module Ehbrs
  module Executables
    class << self
      include ::EacRubyUtils::SimpleCache

      def env
        ::EacRubyUtils::Envs.local
      end

      private

      {
        '-?' => %w[rar],
        '-h' => %w[unzip],
        '-version' => %w[ffmpeg],
        '--version' => %w[flips tar wit]
      }.each do |validate_arg, commands|
        commands.each do |command|
          define_method("#{command}_uncached") do
            env.executable(command, validate_arg)
          end
        end
      end

      def sevenzip_uncached
        env.executable('7z', '--help')
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
ehbrs-tools-0.38.0 lib/ehbrs/executables.rb
ehbrs-tools-0.37.0 lib/ehbrs/executables.rb
ehbrs-tools-0.36.0 lib/ehbrs/executables.rb
ehbrs-tools-0.35.1 lib/ehbrs/executables.rb
ehbrs-tools-0.35.0 lib/ehbrs/executables.rb
ehbrs-tools-0.34.0 lib/ehbrs/executables.rb
ehbrs-tools-0.33.0 lib/ehbrs/executables.rb
ehbrs-tools-0.32.0 lib/ehbrs/executables.rb
ehbrs-tools-0.31.1 lib/ehbrs/executables.rb
ehbrs-tools-0.31.0 lib/ehbrs/executables.rb
ehbrs-tools-0.30.0 lib/ehbrs/executables.rb
ehbrs-tools-0.29.0 lib/ehbrs/executables.rb
ehbrs-tools-0.28.3 lib/ehbrs/executables.rb
ehbrs-tools-0.28.2 lib/ehbrs/executables.rb
ehbrs-tools-0.28.1 lib/ehbrs/executables.rb
ehbrs-tools-0.28.0 lib/ehbrs/executables.rb
ehbrs-tools-0.27.0 lib/ehbrs/executables.rb
ehbrs-tools-0.26.0 lib/ehbrs/executables.rb
ehbrs-tools-0.25.1 lib/ehbrs/executables.rb
ehbrs-tools-0.25.0 lib/ehbrs/executables.rb