Class: Pronto::Formatter::GitFormatter

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

Direct Known Subclasses

CommitFormatter, PullRequestFormatter

Instance Method Summary collapse

Instance Method Details

#client_moduleObject

Raises:

  • (NotImplementedError)


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

def client_module
  raise NotImplementedError
end

#format(messages, repo, patches) ⇒ Object



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

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

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

#pretty_nameObject

Raises:

  • (NotImplementedError)


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

def pretty_name
  raise NotImplementedError
end