Sha256: aaa198446c31a3ecf52bfe4b3420dc44e3270afb4037915becaf526be4a8dc46

Contents?: true

Size: 1.87 KB

Versions: 21

Compression:

Stored size: 1.87 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

21 entries across 21 versions & 1 rubygems

Version Path
avm-tools-0.116.1 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.116.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.115.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.114.2 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.114.1 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.114.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.113.6 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.113.5 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.113.4 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.113.3 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.113.2 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.113.1 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.113.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.112.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.111.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.110.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.109.1 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.109.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.108.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
avm-tools-0.107.0 lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb