Class: Avm::Git::Scms::GitSubtree

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

Instance Method Summary collapse

Methods inherited from GitSubBase

#changed_files, #interval

Instance Method Details

#no_other_git_scm?Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/avm/git/scms/git_subtree.rb', line 8

def no_other_git_scm?
  (::Avm::Git::Scms::Provider.new.all - [self.class])
    .lazy.map { |scm_class| scm_class.new(path) }.none?(&:valid?)
end

#parent_git_scm?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/avm/git/scms/git_subtree.rb', line 14

def parent_git_scm?
  ::Avm::Git::Scms::Provider.new.all.any? { |scm_class| parent_scm.is_a?(scm_class) }
end

#updateObject



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

def update
  # Do nothing
end

#valid?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/avm/git/scms/git_subtree.rb', line 23

def valid?
  parent_git_scm? && no_other_git_scm?
end