Sha256: cbb246396de69c1e00634865a2ea1e3bd867a70a3c0541c7e197fcadcfdfe5c1

Contents?: true

Size: 1.86 KB

Versions: 70

Compression:

Stored size: 1.86 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_base0/core_ext'

module Avm
  module Tools
    class Runner
      class AppSrc
        class Ruby
          class Bundler
            class GemfileLock
              module Git
                private

                def git_continue
                  return unless check_capability(__method__, :git_repo, :continue)

                  infom "Adding \"#{gemfile_lock}\"..."
                  instance.git_repo.command('add', gemfile_lock).execute!
                  if rebase_conflict?
                    git_continue_run('rebase')
                  elsif cherry_conflict?
                    git_continue_run('cherry-pick')
                  else
                    raise 'Unknown how to continue'
                  end
                end

                def git_continue_run(command)
                  infom "\"#{command}\" --continue..."
                  cmd = instance.git_repo.command(command, '--continue')
                          .envvar('GIT_EDITOR', 'true')
                  return unless !cmd.system && !conflict?

                  fatal_error "\"#{cmd}\" failed and there is no conflict"
                end

                def git_reset_checkout
                  return unless check_capability(__method__, :git_repo, nil)

                  git_reset_gemfile_lock
                  git_checkout_gemfile_lock
                end

                def git_checkout_gemfile_lock
                  infom 'Checkouting...'
                  instance.git_repo.command('checkout', '--', gemfile_lock).system!
                end

                def git_reset_gemfile_lock
                  infom 'Reseting...'
                  instance.git_repo.command('reset', gemfile_lock).system! if
                  ::File.exist?(gemfile_lock)
                end
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

70 entries across 70 versions & 2 rubygems

Version Path
eac_tools-0.32.0 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.136.2 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.31.1 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.31.0 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.136.1 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.30.0 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.29.0 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.136.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.28.0 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.27.2 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.27.1 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.135.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.27.0 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.134.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.26.0 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.25.1 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.25.0 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.24.1 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.133.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
eac_tools-0.24.0 sub/avm-tools/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb