Class: DarcsReporter

Inherits:
MotiroReporter show all
Defined in:
app/reporters/darcs_reporter.rb

Instance Method Summary collapse

Methods inherited from MotiroReporter

add, button, #buttons, #cache?, caching, #channel_title, #latest_headline, #name, #params_for, reporter_name, title

Constructor Details

#initialize(conn = DarcsConnection.new) ⇒ DarcsReporter

Returns a new instance of DarcsReporter.



25
26
27
# File 'app/reporters/darcs_reporter.rb', line 25

def initialize(conn=DarcsConnection.new)
  @connection = conn
end

Instance Method Details

#author_from_darcs_id(id) ⇒ Object



42
43
44
# File 'app/reporters/darcs_reporter.rb', line 42

def author_from_darcs_id(id)
  id.sub(/@.*$/, '')
end

#headline(rid) ⇒ Object



38
39
40
# File 'app/reporters/darcs_reporter.rb', line 38

def headline(rid)
  parse_headlines(@connection.changes(rid)).first
end

#headlinesObject



34
35
36
# File 'app/reporters/darcs_reporter.rb', line 34

def headlines
  parse_headlines(@connection.changes(:all))
end

#latest_headlines(rid = '') ⇒ Object



29
30
31
32
# File 'app/reporters/darcs_reporter.rb', line 29

def latest_headlines(rid='')
  @connection.pull
  parse_headlines(@connection.changes)
end