Class: Archive

Inherits:
Teron
  • Object
show all
Defined in:
lib/greenhat/archive.rb

Overview

Archive Parent

Instance Method Summary collapse

Instance Method Details

#friendly_nameObject

TODO: Fix from Number of Files / Needed?



117
118
119
120
121
122
# File 'lib/greenhat/archive.rb', line 117

def friendly_name
  # Difficult with multiple Archives
  # File.basename(name, '.tar.gz').gsub('gitlabsos.', '').split('_', 2).first

  File.basename(name, File.extname(name)).gsub('gitlabsos.', '')
end

#inspectObject



124
125
126
# File 'lib/greenhat/archive.rb', line 124

def inspect
  "#<Archive name: '#{name}'>"
end

#report(flags) ⇒ Object



128
129
130
# File 'lib/greenhat/archive.rb', line 128

def report(flags)
  GreenHat::Report.new(self, flags)
end

#report_markdownObject



132
133
134
# File 'lib/greenhat/archive.rb', line 132

def report_markdown
  GreenHat::ReportMarkdown.new(self)
end

#thing?(thing_name = 'gitlab-workhorse/current') ⇒ Boolean

Helper for finding thing

Returns:

  • (Boolean)


137
138
139
# File 'lib/greenhat/archive.rb', line 137

def thing?(thing_name = 'gitlab-workhorse/current')
  things.find { |x| x.name == thing_name }
end