Sha256: 769cf312f4dc0ff041c9b1bf1da13915ce228b71c6c0e37cd0e934bde6dbae1f

Contents?: true

Size: 723 Bytes

Versions: 2

Compression:

Stored size: 723 Bytes

Contents

module EacLauncher
  module Git
    class MirrorUpdate < ::EacLauncher::Path
      include ::Eac::SimpleCache

      def initialize(target_path, source_path, source_rev)
        super(target_path)
        @target_git = ::EacLauncher::Git::Base.new(self)
        @source_git = ::EacLauncher::Git::Base.new(source_path)
        @source_rev = source_rev
        run
      end

      private

      def run
        fetch_remote_source
        reset_source_rev
      end

      def fetch_remote_source
        @target_git.git
        @target_git.fetch("file://#{@source_git}", tags: true)
      end

      def reset_source_rev
        @target_git.reset_hard(@source_git.rev_parse(@source_rev, true))
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eac_launcher-0.2.0 lib/eac_launcher/git/mirror_update.rb
eac_launcher-0.1.7 lib/eac_launcher/git/mirror_update.rb