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



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

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

#add_subrepos(*subpath_list) ⇒ Object



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

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

#check_optionsObject



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

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

#show_resultObject



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

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