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.24.0 lib/ehbrs/executables.rb
ehbrs-tools-0.23.1 lib/ehbrs/executables.rb
ehbrs-tools-0.23.0 lib/ehbrs/executables.rb
ehbrs-tools-0.22.0 lib/ehbrs/executables.rb
ehbrs-tools-0.21.0 lib/ehbrs/executables.rb
ehbrs-tools-0.20.0 lib/ehbrs/executables.rb
ehbrs-tools-0.19.0 lib/ehbrs/executables.rb
ehbrs-tools-0.18.0 lib/ehbrs/executables.rb
ehbrs-tools-0.17.0 lib/ehbrs/executables.rb
ehbrs-tools-0.16.5 lib/ehbrs/executables.rb
ehbrs-tools-0.16.4 lib/ehbrs/executables.rb
ehbrs-tools-0.16.3 lib/ehbrs/executables.rb
ehbrs-tools-0.16.2 lib/ehbrs/executables.rb
ehbrs-tools-0.16.1 lib/ehbrs/executables.rb
ehbrs-tools-0.16.0 lib/ehbrs/executables.rb
ehbrs-tools-0.15.0 lib/ehbrs/executables.rb
ehbrs-tools-0.14.1 lib/ehbrs/executables.rb
ehbrs-tools-0.14.0 lib/ehbrs/executables.rb