Sha256: a9450467b077d9e2610e28a533f0d43353f8b86e3700e837b83bd990e9847bf4

Contents?: true

Size: 836 Bytes

Versions: 68

Compression:

Stored size: 836 Bytes

Contents

# frozen_string_literal: true

require 'avm/git/scms/git_sub_base'
require 'eac_git/local'
require 'eac_ruby_utils/core_ext'

module Avm
  module Git
    module Scms
      class GitSubrepo < ::Avm::Git::Scms::GitSubBase
        def update
          git_subrepo.command('clean').execute!
          git_subrepo.command('pull').execute!
        end

        # @return [EacGit::Local]
        def git_repo
          @git_repo ||= ::EacGit::Local.find(path)
        end

        # @return [EacGit::Local::Subrepo]
        def git_subrepo
          @git_subrepo ||= git_repo.subrepo(subpath)
        end

        # @return [Pathname]
        def subpath
          path.expand_path.relative_path_from(git_repo.root_path.expand_path)
        end

        def valid?
          path.join('.gitrepo').file?
        end
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 2 rubygems

Version Path
eac_tools-0.64.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.63.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.62.1 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.62.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-git-0.13.2 lib/avm/git/scms/git_subrepo.rb
eac_tools-0.61.1 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.61.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.60.3 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.60.2 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.60.1 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.60.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.59.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.58.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.57.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.56.1 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.56.0 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.55.7 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
avm-git-0.13.1 lib/avm/git/scms/git_subrepo.rb
eac_tools-0.55.6 sub/avm-git/lib/avm/git/scms/git_subrepo.rb
eac_tools-0.55.5 sub/avm-git/lib/avm/git/scms/git_subrepo.rb