Sha256: 94fb8e74630708900f5972ea6b2d0b8dbc9cefc253946d491130c2be0d3931ba

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

module EacLauncher
  module Git
    # Métodos abstratos:
    #  * source_instance
    #  * source_remote_name
    #  * current_ref
    class WarpBase < ::EacLauncher::Path
      include ::Eac::SimpleCache

      TARGET_REMOTE = 'target'.freeze

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

      protected

      attr_reader :instance

      def update
        ::EacLauncher::Git::MirrorUpdate.new(
          path,
          source_instance,
          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)
      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

8 entries across 8 versions & 1 rubygems

Version Path
eac_launcher-0.2.0 lib/eac_launcher/git/warp_base.rb
eac_launcher-0.1.7 lib/eac_launcher/git/warp_base.rb
eac_launcher-0.1.6 lib/eac_launcher/git/warp_base.rb
eac_launcher-0.1.5 lib/eac_launcher/git/warp_base.rb
eac_launcher-0.1.3 lib/eac_launcher/git/warp_base.rb
eac_launcher-0.1.4 lib/eac_launcher/git/warp_base.rb
eac_launcher-0.1.2 lib/eac_launcher/git/warp_base.rb
eac_launcher-0.1.1 lib/eac_launcher/git/warp_base.rb