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)


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

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)


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

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

#updateObject



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

def update
  # Do nothing
end

#valid?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/avm/git/scms/git_subtree.rb', line 28

def valid?
  parent_git_scm? && no_other_git_scm?
end