Class: Pronto::Formatter::GitFormatter

Inherits:
Base
  • Object
show all
Defined in:
lib/pronto/formatter/git_formatter.rb

Direct Known Subclasses

CommitFormatter, PullRequestFormatter

Instance Method Summary collapse

Methods inherited from Base

#config, name

Instance Method Details

#client_moduleObject

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/pronto/formatter/git_formatter.rb', line 14

def client_module
  raise NotImplementedError
end

#format(messages, repo, patches) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/pronto/formatter/git_formatter.rb', line 4

def format(messages, repo, patches)
  client = client_module.new(repo)
  existing = existing_comments(messages, client, repo)
  comments = new_comments(messages, patches)
  additions = remove_duplicate_comments(existing, comments)
  submit_comments(client, additions)

  "#{additions.count} Pronto messages posted to #{pretty_name}"
end

#pretty_nameObject

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/pronto/formatter/git_formatter.rb', line 18

def pretty_name
  raise NotImplementedError
end