Class: Omgcnb::DisplayAllDeps

Inherits:
Object
  • Object
show all
Defined in:
lib/omgcnb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buildpack, io: STDOUT) ⇒ DisplayAllDeps

Returns a new instance of DisplayAllDeps.



34
35
36
37
# File 'lib/omgcnb.rb', line 34

def initialize(buildpack, io: STDOUT)
  @buildpack = buildpack
  @io = io
end

Instance Attribute Details

#buildpackObject (readonly)

Returns the value of attribute buildpack.



32
33
34
# File 'lib/omgcnb.rb', line 32

def buildpack
  @buildpack
end

#ioObject (readonly)

Returns the value of attribute io.



32
33
34
# File 'lib/omgcnb.rb', line 32

def io
  @io
end

Instance Method Details

#callObject



39
40
41
42
43
44
45
46
# File 'lib/omgcnb.rb', line 39

def call
  io.puts "- #{buildpack.name}"
  if buildpack.depends_on.any?
    io.puts "#{buildpack.depends_on(show_optional: true).map {|s| "  - #{s}" }.join("\n")}"
  else
    io.puts "  - (no deps)"
  end
end