Class: CommitFormat::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/commit_format/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Cli

Returns a new instance of Cli.



7
8
9
# File 'lib/commit_format/cli.rb', line 7

def initialize(args)
  @args = parse_args(args)
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/commit_format/cli.rb', line 11

def execute
  parser = Parser.new(@args)
  commits = parser.commits

  formatter =
    Formatter.new(
      commits,
      :paragraph => @args.fetch(:paragraph, false)
    )
  formatted_commits = formatter.formatted_commits
  print_formatted_commits(formatted_commits)
end