Class: GitReport::Sender

Inherits:
GenericSender show all
Defined in:
lib/sender.rb

Class Method Summary collapse

Methods inherited from GenericSender

communicate, configuration, headers, storage

Class Method Details

.send!(options = nil) ⇒ Object

sends or saves the commits



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/sender.rb', line 6

def self.send! options = nil
  begin
    commits = GitReport::Supplier.commits(options)
  rescue Exception => e
    communicate e, nil
    exit
  end

  commits.each do |commit|
    send_data!(commit) ? commits = commits.inject([]){ |a,i| ( a << i unless i == commit );a } : break
  end
  storage.save! commits

  true
end