# encoding: utf-8 require 'bundler' require 'bundler/gem_tasks' begin Bundler.setup(:default, :development) rescue Bundler::BundlerError => e $stderr.puts e.message $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code end require './lib/hawkins/version' require 'rake' require 'rdoc/task' require 'rubocop/rake_task' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec, :tag) do |t, task_args| t.rspec_opts = "--tag #{task_args[:tag]}" if task_args.key?(:tag) t.pattern = "test/**/*.rb" end task :default => :spec task :test => :spec desc "Code coverage detail" task :simplecov do ENV['COVERAGE'] = "true" Rake::Task['test'].execute end Rake::RDocTask.new do |rdoc| version = File.exist?('VERSION') ? File.read('VERSION') : "" rdoc.rdoc_dir = 'rdoc' rdoc.title = "hawkins #{version}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end RuboCop::RakeTask.new do |task| task.formatters = ['fuubar'] task.options = ['-D'] end desc "Pre-commit checks" task :check => [:rubocop, :spec]