mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Build distributables under pkg/ instead of dist/ (per blake's request)
While here, clean up some random cruft in the Rakefile
This commit is contained in:
parent
d5f2028d5a
commit
230f1ea10d
2 changed files with 9 additions and 20 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,9 +1,9 @@
|
|||
*.log
|
||||
.DS_Store
|
||||
/dist
|
||||
/pkg
|
||||
/book
|
||||
/doc/api
|
||||
/doc/*.html
|
||||
.#*
|
||||
\#*
|
||||
.emacs*
|
||||
.emacs*
|
||||
|
|
25
Rakefile
25
Rakefile
|
@ -33,7 +33,7 @@ def spec
|
|||
end
|
||||
|
||||
def package(ext='')
|
||||
"dist/sinatra-#{spec.version}" + ext
|
||||
"pkg/sinatra-#{spec.version}" + ext
|
||||
end
|
||||
|
||||
desc 'Build packages'
|
||||
|
@ -44,15 +44,15 @@ task :install => package('.gem') do
|
|||
sh "gem install #{package('.gem')}"
|
||||
end
|
||||
|
||||
directory 'dist/'
|
||||
CLOBBER.include('dist')
|
||||
directory 'pkg/'
|
||||
CLOBBER.include('pkg')
|
||||
|
||||
file package('.gem') => %w[dist/ sinatra.gemspec] + spec.files do |f|
|
||||
file package('.gem') => %w[pkg/ sinatra.gemspec] + spec.files do |f|
|
||||
sh "gem build sinatra.gemspec"
|
||||
mv File.basename(f.name), f.name
|
||||
end
|
||||
|
||||
file package('.tar.gz') => %w[dist/] + spec.files do |f|
|
||||
file package('.tar.gz') => %w[pkg/] + spec.files do |f|
|
||||
sh <<-SH
|
||||
git archive \
|
||||
--prefix=sinatra-#{source_version}/ \
|
||||
|
@ -64,7 +64,7 @@ end
|
|||
# Rubyforge Release / Publish Tasks ==================================
|
||||
|
||||
desc 'Publish gem and tarball to rubyforge'
|
||||
task 'publish:gem' => [package('.gem'), package('.tar.gz')] do |t|
|
||||
task 'release' => [package('.gem'), package('.tar.gz')] do |t|
|
||||
sh <<-end
|
||||
rubyforge add_release sinatra sinatra #{spec.version} #{package('.gem')} &&
|
||||
rubyforge add_file sinatra sinatra #{spec.version} #{package('.tar.gz')}
|
||||
|
@ -95,12 +95,6 @@ file 'doc/api/index.html' => FileList['lib/**/*.rb','README.rdoc'] do |f|
|
|||
end
|
||||
CLEAN.include 'doc/api'
|
||||
|
||||
def rdoc_to_html(file_name)
|
||||
require 'rdoc/markup/to_html'
|
||||
rdoc = RDoc::Markup::ToHtml.new
|
||||
rdoc.convert(File.read(file_name))
|
||||
end
|
||||
|
||||
# Gemspec Helpers ====================================================
|
||||
|
||||
def source_version
|
||||
|
@ -108,12 +102,7 @@ def source_version
|
|||
line.match(/.*VERSION = '(.*)'/)[1]
|
||||
end
|
||||
|
||||
project_files =
|
||||
FileList[
|
||||
'{lib,test,compat,images}/**',
|
||||
'Rakefile', 'CHANGES', 'README.rdoc'
|
||||
]
|
||||
file 'sinatra.gemspec' => project_files do |f|
|
||||
task 'sinatra.gemspec' => FileList['{lib,test,compat}/**','Rakefile','CHANGES','*.rdoc'] do |f|
|
||||
# read spec file and split out manifest section
|
||||
spec = File.read(f.name)
|
||||
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
||||
|
|
Loading…
Reference in a new issue