Class: Avm::Git::SubrepoChecks

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_remoteObject

Returns the value of attribute check_remote.



11
12
13
# File 'lib/avm/git/subrepo_checks.rb', line 11

def check_remote
  @check_remote
end

#fix_parentObject

Returns the value of attribute fix_parent.



11
12
13
# File 'lib/avm/git/subrepo_checks.rb', line 11

def fix_parent
  @fix_parent
end

Instance Method Details

#add_all_subreposObject



15
16
17
18
19
20
# File 'lib/avm/git/subrepo_checks.rb', line 15

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

#add_subrepos(*subpath_list) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/avm/git/subrepo_checks.rb', line 22

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

#check_optionsObject



30
31
32
# File 'lib/avm/git/subrepo_checks.rb', line 30

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

#show_resultObject



34
35
36
37
# File 'lib/avm/git/subrepo_checks.rb', line 34

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