Class: Schmersion::Helpers

Inherits:
Object
  • Object
show all
Defined in:
lib/schmersion/helpers.rb

Class Method Summary collapse

Class Method Details



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/schmersion/helpers.rb', line 8

def print_commit_list(commits, prefix: '')
  commits.each do |commit|
    print prefix
    print '['
    print commit.ref[0, 10].blue
    print ']'
    print ' '
    print commit.message.type.green
    if commit.message.scope
      print '('
      print commit.message.scope.magenta
      print ')'
    end
    if commit.message.breaking_change?
      print ' ! '.white.on_red
    end
    print ': '
    puts commit.message.description
  end
end