homebrew-cask/Rakefile

54 lines
1.4 KiB
Ruby
Raw Normal View History

2016-07-03 00:54:47 +08:00
require "coveralls/rake/task"
require "rake/testtask"
require "rspec/core/rake_task"
require "rubocop/rake_task"
homebrew_repo = `brew --repository`
$LOAD_PATH.unshift(File.expand_path("#{homebrew_repo.chomp}/Library/Homebrew"))
2016-07-03 00:54:47 +08:00
$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))
namespace :test do
Rake::TestTask.new(:minitest) do |t|
# TODO: setting the --seed here is an ugly temporary hack, to remain only
# until test-suite glitches are fixed.
2016-07-03 00:54:47 +08:00
ENV["TESTOPTS"] = "--seed=14830" if ENV["TRAVIS"]
t.pattern = "test/**/*_test.rb"
2016-07-03 00:54:47 +08:00
t.libs << "test"
end
RSpec::Core::RakeTask.new(:rspec)
2016-07-03 00:54:47 +08:00
desc "Run tests for minitest and RSpec with coverage"
task :coverage do
2016-07-03 00:54:47 +08:00
ENV["COVERAGE"] = "1"
Rake::Task[:test].invoke
end
end
2016-07-03 00:54:47 +08:00
desc "Run tests for minitest and RSpec"
task test: ["test:minitest", "test:rspec"]
Coveralls::RakeTask.new
RuboCop::RakeTask.new(:rubocop) do |t|
2016-07-03 00:54:47 +08:00
t.options = ["--force-exclusion"]
2015-03-04 14:52:42 +08:00
end
2016-07-03 00:54:47 +08:00
task default: [:test, :rubocop]
2015-01-27 20:34:16 +08:00
2016-07-03 00:54:47 +08:00
desc "Open a REPL for debugging and experimentation"
2015-01-27 20:34:16 +08:00
task :console do
2016-07-03 00:54:47 +08:00
require "pry"
require "pry-byebug"
require "vendor/homebrew-fork/global"
require "hbc"
ARGV.clear
Hbc.pry
2015-01-27 20:34:16 +08:00
end
2016-01-05 04:52:06 +08:00
2016-07-03 00:54:47 +08:00
desc "Generate man page from Markdown source"
2016-01-05 04:52:06 +08:00
task :man do
2016-07-03 00:54:47 +08:00
sh "ronn --roff --pipe --organization=Homebrew-cask --manual=brew-cask " \
"doc/man_page/brew-cask.1.md > man/man1/brew-cask.1"
2016-01-05 04:52:06 +08:00
end