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
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/dist
|
/pkg
|
||||||
/book
|
/book
|
||||||
/doc/api
|
/doc/api
|
||||||
/doc/*.html
|
/doc/*.html
|
||||||
.#*
|
.#*
|
||||||
\#*
|
\#*
|
||||||
.emacs*
|
.emacs*
|
||||||
|
|
25
Rakefile
25
Rakefile
|
@ -33,7 +33,7 @@ def spec
|
||||||
end
|
end
|
||||||
|
|
||||||
def package(ext='')
|
def package(ext='')
|
||||||
"dist/sinatra-#{spec.version}" + ext
|
"pkg/sinatra-#{spec.version}" + ext
|
||||||
end
|
end
|
||||||
|
|
||||||
desc 'Build packages'
|
desc 'Build packages'
|
||||||
|
@ -44,15 +44,15 @@ task :install => package('.gem') do
|
||||||
sh "gem install #{package('.gem')}"
|
sh "gem install #{package('.gem')}"
|
||||||
end
|
end
|
||||||
|
|
||||||
directory 'dist/'
|
directory 'pkg/'
|
||||||
CLOBBER.include('dist')
|
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"
|
sh "gem build sinatra.gemspec"
|
||||||
mv File.basename(f.name), f.name
|
mv File.basename(f.name), f.name
|
||||||
end
|
end
|
||||||
|
|
||||||
file package('.tar.gz') => %w[dist/] + spec.files do |f|
|
file package('.tar.gz') => %w[pkg/] + spec.files do |f|
|
||||||
sh <<-SH
|
sh <<-SH
|
||||||
git archive \
|
git archive \
|
||||||
--prefix=sinatra-#{source_version}/ \
|
--prefix=sinatra-#{source_version}/ \
|
||||||
|
@ -64,7 +64,7 @@ end
|
||||||
# Rubyforge Release / Publish Tasks ==================================
|
# Rubyforge Release / Publish Tasks ==================================
|
||||||
|
|
||||||
desc 'Publish gem and tarball to rubyforge'
|
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
|
sh <<-end
|
||||||
rubyforge add_release sinatra sinatra #{spec.version} #{package('.gem')} &&
|
rubyforge add_release sinatra sinatra #{spec.version} #{package('.gem')} &&
|
||||||
rubyforge add_file sinatra sinatra #{spec.version} #{package('.tar.gz')}
|
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
|
end
|
||||||
CLEAN.include 'doc/api'
|
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 ====================================================
|
# Gemspec Helpers ====================================================
|
||||||
|
|
||||||
def source_version
|
def source_version
|
||||||
|
@ -108,12 +102,7 @@ def source_version
|
||||||
line.match(/.*VERSION = '(.*)'/)[1]
|
line.match(/.*VERSION = '(.*)'/)[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
project_files =
|
task 'sinatra.gemspec' => FileList['{lib,test,compat}/**','Rakefile','CHANGES','*.rdoc'] do |f|
|
||||||
FileList[
|
|
||||||
'{lib,test,compat,images}/**',
|
|
||||||
'Rakefile', 'CHANGES', 'README.rdoc'
|
|
||||||
]
|
|
||||||
file 'sinatra.gemspec' => project_files do |f|
|
|
||||||
# read spec file and split out manifest section
|
# read spec file and split out manifest section
|
||||||
spec = File.read(f.name)
|
spec = File.read(f.name)
|
||||||
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
||||||
|
|
Loading…
Reference in a new issue