Module: Git::Blames

Includes:
Emails
Included in:
Pending
Defined in:
lib/blames.rb

Defined Under Namespace

Classes: Pending

Instance Method Summary collapse

Methods included from Emails

#load_configuration, #send_gmail

Instance Method Details

#blame(options = nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/blames.rb', line 4

def blame(options = nil)
  if !options[:spam]
    self.tasks_by_collaborator.each_pair do |recipient, message|
      send_gmail( 
        :recipients => [recipient],
        :subject => "Please collaborate to fix consolidated list of specs: ",
        :message => message
      )
    end
  else
    self.tasks.each_pair do |key, attributes|
      if options.nil? || !options[:email]
        stdout key, attributes
      else
        send_gmail :recipients => attributes[:contributors],
          :subject => "Please collaborate to fix spec: " +
            "#{attributes[:spec_file]} : " +
            "#{attributes[:line_number]}",
          :message => "Spec Details:\n  " +
            "Details\n  #{attributes[:details].join('\n')}\n" +
            "Collaborators:\n  #{attributes[:contributors].join(', ')}\n"
      end
    end
  end
end

#stdout(key, attributes) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/blames.rb', line 30

def stdout key, attributes
  puts "\nPending Spec Information:"
  puts "  Description: #{key}"
  puts "  Contributors: #{attributes[:contributors].join(', ')}"
  puts "  File: #{attributes[:spec_file]}"
  puts "  Line: #{attributes[:line_number]}\n"
end