Method: Metior::Report.create

Defined in:
lib/metior/report.rb

.create(name, repository, range = repository.vcs::DEFAULT_BRANCH) ⇒ Object

Create a new report instance for the given report name, repository and commit range

Parameters:

  • name (String, Symbol)

    The name of the report to load and initialize

  • repository (Repository)

    The repository to analyze

  • range (String, Range) (defaults to: repository.vcs::DEFAULT_BRANCH)

    The commit range to analyze

[View source]

42
43
44
45
46
# File 'lib/metior/report.rb', line 42

def self.create(name, repository, range = repository.vcs::DEFAULT_BRANCH)
  require File.join(REPORTS_PATH, name.to_s)
  name = name.to_s.split('_').map { |n| n.capitalize }.join('')
  const_get(name.to_sym).new(repository, range)
end