Class: Avm::Git::Subrepo::Checks

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/git/subrepo/checks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#check_remote ⇒ Object

Returns the value of attribute check_remote.



9
10
11
# File 'lib/avm/git/subrepo/checks.rb', line 9

def check_remote
  @check_remote
end

#fix_parent ⇒ Object

Returns the value of attribute fix_parent.



9
10
11
# File 'lib/avm/git/subrepo/checks.rb', line 9

def fix_parent
  @fix_parent
end

Instance Method Details

#add_all_subrepos ⇒ Object



13
14
15
16
17
18
# File 'lib/avm/git/subrepo/checks.rb', line 13

def add_all_subrepos
  add_subrepos(
    *repository.command('subrepo', '-q', 'status').execute!.split("\n").map(&:strip)
    .select(&:present?)
  )
end

#add_subrepos(*subpath_list) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/avm/git/subrepo/checks.rb', line 20

def add_subrepos(*subpath_list)
  subpath_list.each do |subpath|
    subpaths.add(subpath)
  end
  reset_cache
  self
end

#check_options ⇒ Object



28
29
30
# File 'lib/avm/git/subrepo/checks.rb', line 28

def check_options
  { fix_parent: fix_parent, check_remote: check_remote }
end

#show_result ⇒ Object



32
33
34
35
# File 'lib/avm/git/subrepo/checks.rb', line 32

def show_result
  checks.each(&:show_result)
  infov 'Result', result.label
end