Created
May 18, 2014 15:56
-
-
Save renier/fc3c5bf0a87d239db972 to your computer and use it in GitHub Desktop.
PackageTask example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/gem_tasks' | |
require 'rake/packagetask' | |
require 'rubocop/rake_task' | |
require 'rspec/core/rake_task' | |
ROOT_DIR = File.dirname(__FILE__) | |
gemspec = Gem::Specification.load("#{Dir.glob(ROOT_DIR + '/*.gemspec')[0]}") | |
RSpec::Core::RakeTask.new(:spec) do |t| | |
t.rspec_opts = '-f d -c' | |
end | |
task :rubocop do | |
Rubocop::RakeTask.new | |
end | |
Rake::PackageTask.new(gemspec.name, gemspec.version.to_s) do |pkg| | |
pkg.need_tar_bz2 = pkg.need_zip = true | |
pkg.package_files = gemspec.files | |
end | |
task default: [:rubocop, :spec] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment