Class: Avm::Git::Scms::GitSubrepo

Inherits:
GitSubBase
  • Object
show all
Defined in:
lib/avm/git/scms/git_subrepo.rb

Instance Method Summary collapse

Methods inherited from GitSubBase

#changed_files, #interval

Instance Method Details

#git_subrepo ⇒ EacGit::Local::Subrepo

Returns:

  • (EacGit::Local::Subrepo)


13
14
15
# File 'lib/avm/git/scms/git_subrepo.rb', line 13

def git_subrepo
  @git_subrepo ||= git_repo.subrepo(subpath)
end

#subpath ⇒ Pathname

Returns:

  • (Pathname)


18
19
20
# File 'lib/avm/git/scms/git_subrepo.rb', line 18

def subpath
  path.expand_path.relative_path_from(git_repo.root_path.expand_path)
end

#update ⇒ Object



7
8
9
10
# File 'lib/avm/git/scms/git_subrepo.rb', line 7

def update
  git_subrepo.command('clean').execute!
  git_subrepo.command('pull').execute!
end

#valid? ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/avm/git/scms/git_subrepo.rb', line 22

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