mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
rake task for updating sinatra.gemspec files manifest
This commit is contained in:
parent
6bee4770f0
commit
8c412cf5bf
2 changed files with 23 additions and 1 deletions
21
Rakefile
21
Rakefile
|
@ -52,6 +52,27 @@ file package('.tar.gz') => %w[dist/] + spec.files do |f|
|
|||
sh "git archive --format=tar HEAD | gzip > #{f.name}"
|
||||
end
|
||||
|
||||
# Gemspec Helpers ====================================================
|
||||
|
||||
file 'sinatra.gemspec' => FileList['{lib,test,images}/**','Rakefile'] do |f|
|
||||
# read spec file and split out manifest section
|
||||
spec = File.read(f.name)
|
||||
parts = spec.split(" # = MANIFEST =\n")
|
||||
fail 'bad spec' if parts.length != 3
|
||||
# determine file list from git ls-files
|
||||
files = `git ls-files`.
|
||||
split("\n").
|
||||
sort.
|
||||
reject{ |file| file =~ /^\./ }.
|
||||
map{ |file| " #{file}" }.
|
||||
join("\n")
|
||||
# piece file back together and write...
|
||||
parts[1] = " s.files = %w[\n#{files}\n ]\n"
|
||||
spec = parts.join(" # = MANIFEST =\n")
|
||||
File.open(f.name, 'w') { |io| io.write(spec) }
|
||||
puts "updated #{f.name}"
|
||||
end
|
||||
|
||||
# Hanna RDoc =========================================================
|
||||
#
|
||||
# Building docs requires the hanna gem:
|
||||
|
|
|
@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|||
|
||||
s.authors = ["Blake Mizerany"]
|
||||
|
||||
# git ls-files | grep -v '^\.'
|
||||
# = MANIFEST =
|
||||
s.files = %w[
|
||||
images/404.png
|
||||
images/500.png
|
||||
|
@ -58,6 +58,7 @@ Gem::Specification.new do |s|
|
|||
test/views/no_layout/no_layout.builder
|
||||
test/views/no_layout/no_layout.haml
|
||||
]
|
||||
# = MANIFEST =
|
||||
|
||||
s.test_files = s.files.select {|path| path =~ /^test\/.*_test.rb/}
|
||||
|
||||
|
|
Loading…
Reference in a new issue