Sha256: 8f5d810d8c87caf4b9e3a2fac67c5b882f876c43787c6a1e05619a4b181cf495

Contents?: true

Size: 1.28 KB

Versions: 61

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

require 'eac_launcher/git/mirror_update'
require 'eac_launcher/vendor/github'
require 'avm/projects/stereotypes/git/publish'

module EacLauncher
  module Git
    # Métodos abstratos:
    #  * source_instance
    #  * source_remote_name
    #  * current_ref
    class WarpBase < ::EacLauncher::Paths::Real
      include ::EacRubyUtils::SimpleCache

      TARGET_REMOTE = ::Avm::Projects::Stereotypes::Git::Publish::PUBLISH_GIT_REMOTE_NAME

      def initialize(instance)
        @instance = instance
        cache_git.git.reset_hard(current_ref)
        cache_git.remote(TARGET_REMOTE).url = target_remote_url
        super(path)
      end

      protected

      attr_reader :instance

      def update
        ::EacLauncher::Git::MirrorUpdate.new(
          path,
          source_instance.real,
          source_instance.options.git_current_revision
        )
      end

      def path
        instance.cache_path('git_repository')
      end

      def source_git_uncached
        ::EacLauncher::Git::Base.new(source_instance.real)
      end

      def cache_git_uncached
        ::EacLauncher::Git::Base.new(update)
      end

      def target_remote_url
        ::EacLauncher::Vendor::Github.to_ssh_url(source_git.git.remote(source_remote_name).url)
      end
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
avm-tools-0.99.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.98.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.97.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.96.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.95.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.94.3 lib/eac_launcher/git/warp_base.rb
avm-tools-0.94.2 lib/eac_launcher/git/warp_base.rb
avm-tools-0.94.1 lib/eac_launcher/git/warp_base.rb
avm-tools-0.94.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.93.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.92.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.91.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.90.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.89.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.88.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.87.1 lib/eac_launcher/git/warp_base.rb
avm-tools-0.87.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.86.0 lib/eac_launcher/git/warp_base.rb
avm-tools-0.85.1 lib/eac_launcher/git/warp_base.rb
avm-tools-0.85.0 lib/eac_launcher/git/warp_base.rb