Module: Pronto::Formatter

Defined in:
lib/pronto/formatter/base.rb,
lib/pronto/formatter/formatter.rb,
lib/pronto/formatter/colorizable.rb,
lib/pronto/formatter/git_formatter.rb,
lib/pronto/formatter/json_formatter.rb,
lib/pronto/formatter/null_formatter.rb,
lib/pronto/formatter/text_formatter.rb,
lib/pronto/formatter/commit_formatter.rb,
lib/pronto/formatter/github_formatter.rb,
lib/pronto/formatter/gitlab_formatter.rb,
lib/pronto/formatter/bitbucket_formatter.rb,
lib/pronto/formatter/checkstyle_formatter.rb,
lib/pronto/formatter/pull_request_formatter.rb,
lib/pronto/formatter/text_message_decorator.rb,
lib/pronto/formatter/github_status_formatter.rb,
lib/pronto/formatter/github_pull_request_formatter.rb,
lib/pronto/formatter/bitbucket_pull_request_formatter.rb,
lib/pronto/formatter/github_status_formatter/sentence.rb,
lib/pronto/formatter/github_pull_request_review_formatter.rb,
lib/pronto/formatter/github_status_formatter/status_builder.rb,
lib/pronto/formatter/bitbucket_server_pull_request_formatter.rb

Defined Under Namespace

Modules: Colorizable Classes: Base, BitbucketFormatter, BitbucketPullRequestFormatter, BitbucketServerPullRequestFormatter, CheckstyleFormatter, CommitFormatter, GitFormatter, GithubFormatter, GithubPullRequestFormatter, GithubPullRequestReviewFormatter, GithubStatusFormatter, GitlabFormatter, JsonFormatter, NullFormatter, PullRequestFormatter, TextFormatter, TextMessageDecorator

Constant Summary collapse

FORMATTERS =
{
  'github' => GithubFormatter,
  'github_status' => GithubStatusFormatter,
  'github_pr' => GithubPullRequestFormatter,
  'github_pr_review' => GithubPullRequestReviewFormatter,
  'gitlab' => GitlabFormatter,
  'bitbucket' => BitbucketFormatter,
  'bitbucket_pr' => BitbucketPullRequestFormatter,
  'bitbucket_server_pr' => BitbucketServerPullRequestFormatter,
  'json' => JsonFormatter,
  'checkstyle' => CheckstyleFormatter,
  'text' => TextFormatter,
  'null' => NullFormatter
}.freeze

Class Method Summary collapse

Class Method Details

.get(names) ⇒ Object



3
4
5
6
7
# File 'lib/pronto/formatter/formatter.rb', line 3

def self.get(names)
  names ||= 'text'
  Array(names).map { |name| FORMATTERS[name.to_s] || TextFormatter }
    .uniq.map(&:new)
end

.namesObject



9
10
11
# File 'lib/pronto/formatter/formatter.rb', line 9

def self.names
  FORMATTERS.keys
end