Class: CookbookRelease::Rake::RepoTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/cookbook-release.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}, &html_block) ⇒ RepoTask

Returns a new instance of RepoTask.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/cookbook-release.rb', line 14

def initialize(opts = {}, &html_block)
  desc 'Display raw changelog between branches'
  task 'changelog:raw', [:sub_dir] do |_, args|
    git = GitUtilities.new('sub_dir': args['sub_dir'])
    puts Changelog.new(git, opts).raw
  end

  desc 'Display raw changelog between branches with risky commits on top'
  task 'changelog:raw_priority', [:sub_dir] do |_, args|
    git = GitUtilities.new(args)
    git = GitUtilities.new('sub_dir': args['sub_dir'])
    puts Changelog.new(git, opts).raw_priority
  end

  desc 'Display html changelog between branches'
  task 'changelog:html', [:sub_dir] do |_, args|
    git = GitUtilities.new('sub_dir': args['sub_dir'])
    html = Changelog.new(git, opts).html
    if block_given?
      html = html_block.call(html)
    end
    puts html
  end

  desc 'Display html changelog between branches with risky commits on top'
  task 'changelog:html_priority', [:sub_dir] do |_, args|
    git = GitUtilities.new('sub_dir': args['sub_dir'])
    html = Changelog.new(git, opts).html_priority
    if block_given?
      html = html_block.call(html)
    end
    puts html
  end

  desc 'Display markdown changelog between branches'
  task 'changelog:markdown', [:sub_dir] do |_, args|
    git = GitUtilities.new('sub_dir': args['sub_dir'])
    puts Changelog.new(git, opts).markdown
  end

  desc 'Display markdown changelog between branches with risky commits on top'
  task 'changelog:markdown_priority', [:sub_dir] do |_, args|
    git = GitUtilities.new('sub_dir': args['sub_dir'])
    puts Changelog.new(git, opts).markdown_priority
  end
end