Class: Harbinger::Exporters::BaseExporter

Inherits:
Object
  • Object
show all
Defined in:
lib/harbinger/exporters/base_exporter.rb

Overview

Base class for exporters that transform project data into various formats

Direct Known Subclasses

CsvExporter, JsonExporter

Constant Summary collapse

COMPONENTS =
%w[ruby rails postgres mysql redis mongo python nodejs rust].freeze
PRODUCT_NAMES =
{
  "ruby" => "ruby",
  "rails" => "rails",
  "postgres" => "postgresql",
  "mysql" => "mysql",
  "redis" => "redis",
  "mongo" => "mongodb",
  "python" => "python",
  "nodejs" => "nodejs",
  "rust" => "rust"
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(projects, fetcher: nil) ⇒ BaseExporter

Returns a new instance of BaseExporter.



23
24
25
26
# File 'lib/harbinger/exporters/base_exporter.rb', line 23

def initialize(projects, fetcher: nil)
  @projects = projects
  @fetcher = fetcher || EolFetcher.new
end

Instance Method Details

#exportObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/harbinger/exporters/base_exporter.rb', line 28

def export
  raise NotImplementedError, "Subclasses must implement #export"
end