Class: Git::Duet::AuthorMapper

Inherits:
Object
  • Object
show all
Defined in:
lib/git/duet/author_mapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authors_file = nil, email_lookup = nil) ⇒ AuthorMapper

Returns a new instance of AuthorMapper.



8
9
10
11
12
13
14
# File 'lib/git/duet/author_mapper.rb', line 8

def initialize(authors_file = nil, email_lookup = nil)
  @authors_file = authors_file ||
                  ENV['GIT_DUET_AUTHORS_FILE'] ||
                  File.join(ENV['HOME'], '.git-authors')
  @email_lookup = email_lookup ||
                  ENV['GIT_DUET_EMAIL_LOOKUP_COMMAND']
end

Instance Attribute Details

#authors_file ⇒ Object

Returns the value of attribute authors_file.



6
7
8
# File 'lib/git/duet/author_mapper.rb', line 6

def authors_file
  @authors_file
end

Instance Method Details

#map(*initials_list) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/git/duet/author_mapper.rb', line 16

def map(*initials_list)
  author_map = {}
  initials_list.each do |initials|
    author_map[initials] = author_info(initials)
  end
  author_map
end