Sha256: 8844caa8c06b6c8bda80da655524a546ed2ec19e0af74b245feea70ed4e8195f

Contents?: true

Size: 1 KB

Versions: 170

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'
require 'eac_ruby_utils/envs'

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

      def env
        ::EacRubyUtils::Envs.local
      end

      private

      def git_uncached
        r = env.executable('git', '--version')
        r.extend(GitCommandExtensions)
        r
      end

      def tar_uncached
        env.executable('tar', '--version')
      end

      module GitCommandExtensions
        def command(*args)
          super(*args).envvar('PATH', path_with_git_subrepo)
        end

        def gem_root
          '../..'.to_pathname.expand_path(__dir__)
        end

        def git_subrepo_root
          gem_root.join('vendor', 'git-subrepo')
        end

        def path_with_git_subrepo
          ([git_subrepo_root.join('lib').to_path] +
              ENV['PATH'].if_present('').split(::File::PATH_SEPARATOR))
            .join(::File::PATH_SEPARATOR)
        end
      end
    end
  end
end

Version data entries

170 entries across 170 versions & 3 rubygems

Version Path
eac_tools-0.86.5 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.86.4 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.86.3 sub/eac_git/lib/eac_git/executables.rb
eac_git-0.16.0 lib/eac_git/executables.rb
eac_tools-0.86.2 sub/eac_git/lib/eac_git/executables.rb
eac_git-0.15.0 lib/eac_git/executables.rb
eac_tools-0.84.2 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.84.1 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.84.0 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.83.0 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.82.0 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.81.0 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.80.0 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.79.0 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.78.0 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.77.1 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.77.0 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.76.1 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.76.0 sub/eac_git/lib/eac_git/executables.rb
eac_tools-0.75.2 sub/eac_git/lib/eac_git/executables.rb