Sha256: d4f4d8c3cc80b8d684e1d3f922bd962c6d752b7c99fb1f4bfbd38ce8c1b76948

Contents?: true

Size: 994 Bytes

Versions: 8

Compression:

Stored size: 994 Bytes

Contents

module EacLauncher
  module Git
    class Base < ::EacLauncher::Paths::Real
      module Underlying
        def execute!(*args)
          args, options = build_args(args)
          ::EacRubyUtils::Envs.local.command(*args).execute!(options)
        end

        def system!(*args)
          args, options = build_args(args)
          ::EacRubyUtils::Envs.local.command(*args).system!(options)
        end

        def init
          git
          self
        end

        private

        def build_args(args)
          options = {}
          if args.last.is_a?(Hash)
            options = args.last
            args.pop
          end
          args = args.first if args.first.is_a?(Array)
          [['git', '-C', self, '--no-pager'] + args, options]
        end

        def git_uncached
          FileUtils.mkdir_p(self)
          if File.exist?(subpath('.git'))
            ::Git.open(self)
          else
            ::Git.init(self)
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
eac_launcher-0.5.1 lib/eac_launcher/git/base/underlying.rb
eac_launcher-0.5.0 lib/eac_launcher/git/base/underlying.rb
eac_launcher-0.4.0 lib/eac_launcher/git/base/underlying.rb
eac_launcher-0.3.2 lib/eac_launcher/git/base/underlying.rb
eac_launcher-0.3.1 lib/eac_launcher/git/base/underlying.rb
eac_launcher-0.3.0 lib/eac_launcher/git/base/underlying.rb
eac_launcher-0.2.2 lib/eac_launcher/git/base/underlying.rb
eac_launcher-0.2.1 lib/eac_launcher/git/base/underlying.rb