diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-02-27 11:23:42 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-05 14:55:37 +0100 |
commit | 0bf51048e8ac40df5fa6bf11abc45375109e0a7f (patch) | |
tree | e2b63125819a026c0ac24084821a75ac15440648 /task | |
parent | 9677d2e82e24ed8e72792fd3869db066ccd0b113 (diff) | |
download | bundler-0bf51048e8ac40df5fa6bf11abc45375109e0a7f.tar.gz |
Add a release file list checkno_git_on_gemspec
Diffstat (limited to 'task')
-rw-r--r-- | task/release.rake | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/task/release.rake b/task/release.rake index 3a48c1d255..f22d1296cc 100644 --- a/task/release.rake +++ b/task/release.rake @@ -4,9 +4,33 @@ require "bundler/gem_tasks" task :build => ["build_metadata", "man:build", "generate_files"] do Rake::Task["build_metadata:clean"].tap(&:reenable).real_invoke end -task :release => ["man:require", "man:build", "release:verify_github", "build_metadata"] +task :release => ["man:require", "man:build", "release:verify_files", "release:verify_github", "build_metadata"] namespace :release do + task :verify_files do + git_list = IO.popen("git ls-files -z", &:read).split("\x0").select {|f| f.match(%r{^(lib|exe)/}) } + git_list += %w[CHANGELOG.md LICENSE.md README.md bundler.gemspec] + git_list += Dir.glob("man/**/*") + + gem_list = Gem::Specification.load("bundler.gemspec").files + + extra_files = gem_list.to_set - git_list.to_set + + error_msg = <<~MSG + + You intend to ship some files with the gem that are not generated man pages + nor source control files. Please review the extra list of files and try + again: + + #{extra_files.to_a.join("\n ")} + + MSG + + raise error_msg if extra_files.any? + + puts "The file list is correct for a release." + end + def gh_api_post(opts) gem "netrc", "~> 0.11.0" require "netrc" |