Class: Hookers::Commands::Changelog

Inherits:
Object
  • Object
show all
Includes:
Hookers::Command
Defined in:
lib/hookers/commands/changelog.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Hookers::Command

included, #parse_options

Constructor Details

#initialize(command, args) ⇒ Changelog

Returns a new instance of Changelog.



18
19
20
# File 'lib/hookers/commands/changelog.rb', line 18

def initialize(command, args)
  self.options = parse_options(args)
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



16
17
18
# File 'lib/hookers/commands/changelog.rb', line 16

def options
  @options
end

Class Method Details

.slopObject



8
9
10
11
12
13
14
# File 'lib/hookers/commands/changelog.rb', line 8

def self.slop
  Slop.new(help: true, banner: "Generates changelogs based on commit messages") do
    on :from, "Generate changelog from this refence", argument: true
    on :to, "Generate changelog up to this reference", argument: true
    on :setup, "Copy git hooks files to project .git/hooks ", argument: true
  end
end

Instance Method Details

#runObject



22
23
24
# File 'lib/hookers/commands/changelog.rb', line 22

def run
  puts Hookers::Changelog::Changelogger.new.generate(options)
end