Class: PoiseBoiler::Helpers::Rake::Check

Inherits:
Halite::HelperBase
  • Object
show all
Defined in:
lib/poise_boiler/helpers/rake/check.rb

Overview

Helper for a Rakefile to install tasks for checking the state of projects.

Examples:

Installing tasks

require 'poise_boiler/helpers/rake/check'
PoiseBoiler::Helpers::Rake::Check.install

Checking the current project

$ rake release:check

Since:

  • 1.2.0

Instance Method Summary collapse

Instance Method Details

#install ⇒ void

This method returns an undefined value.

Install the rake tasks.

Since:

  • 1.2.0



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/poise_boiler/helpers/rake/check.rb', line 37

def install
  # Delayed so that Rake doesn't need to be loaded to run this file.
  extend ::Rake::DSL

  desc 'Check for unreleased commits'
  task 'release:check' do
    check_project(base, summary: !!ENV['QUIET'])
  end

  desc 'Check for unreleased commits in all projects'
  task 'release:checkall' do
    base_path = File.expand_path(ENV['POISE_ROOT'] || '~/src')
    Dir.foreach(base_path) do |entry|
      next unless entry =~ /^(poise|application|halite)/
      next if entry =~ /^(application_examples|poise-docker|poise-dash|poise\.io|poise-repomgr)/
      path = File.join(base_path, entry)
      next unless Dir.exist?(File.join(path, '.git'))
      check_project(path, header: "# #{entry}", summary: !ENV['VERBOSE'])
    end
  end

  # Aliases for less typing.
  task 'check' => %w{release:check}
  task 'checkall' => %w{release:checkall}
end