Commit ae1d670d authored by Gunnar Wolf's avatar Gunnar Wolf

Imported Upstream version 2.13.1

parents
This diff is collapsed.
This diff is collapsed.
For installation instructions see http://rmagick.rubyforge.org/install-osx.html
This diff is collapsed.
# Build the tar.gz, tar.bz2, and .gem files for an RMagick Release
# Expects the CVS tag for release RMagick x.y.z to be in the form RMagick_x-y-z.
# To use: cd to $HOME
# run: rake -f path/to/build_tarball.rake clean
# rake -f path/to/build_tarball.rake release=tag beta=whatever
#
# Specify the release as release=RMagick_x-y-z or nothing if release=HEAD
# Specify a beta Release as beta=beta1
require 'rubygems'
require 'redcloth'
require 'find'
require 'fileutils'
include FileUtils
CVSSERVER = ":ext:rmagick@rubyforge.org/var/cvs/rmagick"
# CVS_Tag is the CVS tag for this release. Dist_Directory is CVS_Tag,
# modified for use as a directory name.
if ENV.include?("release")
CVS_Tag = ENV["release"]
Dist_Directory = CVS_Tag.tr('_-','-.')
else
CVS_Tag = "HEAD"
Dist_Directory = "RMagick-0.0.0"
end
# RMagick_Version is just X.Y.Z
RMagick_Version = Dist_Directory.sub(/RMagick-/, "")
# RMagick_Version2 is X.Y.Z + "-beta1" if beta=beta1
RMagick_Version2 = RMagick_Version + (ENV.include?("beta") ? "-" + ENV["beta"] : "")
# Release is RMagick-X.Y.Z, plus "-beta1" if beta=beta1
Release = Dist_Directory + (ENV.include?("beta") ? "-" + ENV["beta"] : "")
README = "README.html"
MANIFEST = "ext/RMagick/MANIFEST"
# Change the version number placeholders in a file.
# Returns an array of lines from the file.
def reversion(name)
now = Time.new
now = now.strftime("%m/%d/%y")
lines = File.readlines name
lines.each do |line|
line.gsub!(%r{0\.0\.0\$}, RMagick_Version2)
line.gsub!(%r{0\.0\.0}, RMagick_Version)
line.gsub!(%r{YY/MM/DD}, now)
end
lines
end
# Rewrite a file containing embedded version number placeholders.
def reversion_file(name)
lines = reversion(name)
tmp_name = name + "_tmp"
mv name, tmp_name
begin
File.open(name, "w") { |f| f.write lines }
rescue
mv tmp_name, name
ensure
rm tmp_name
end
end
task :extconf do
Dir.chdir(Dist_Directory) { reversion_file "ext/RMagick/extconf.rb" }
end
task :gemspec do
Dir.chdir(Dist_Directory) { reversion_file "rmagick.gemspec" }
end
task "README.txt" do
Dir.chdir Dist_Directory do
reversion_file "README.rc"
body = File.readlines "README.rc"
body = RedCloth.new(body.join).to_html + "\n"
File.open("README.txt", "w") { |f| f.write body }
end
end
task README => "README.txt" do
puts "writing #{README}"
Dir.chdir Dist_Directory do
File.open(README, "w") do |html|
html.write <<END_HTML_HEAD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>RMagick #{RMagick_Version2} README</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="RedCloth">
</head>
<body>
END_HTML_HEAD
html.write File.readlines("README.txt")
html.write <<END_HTML_TAIL
</body>
</html>
END_HTML_TAIL
end
end
end
task :doc do
Dir.chdir(File.join(Dist_Directory, "doc")) do
FileList["*.html"].each { |d| reversion_file(d) }
end
end
# Remove files we don't want in the tarball.
# Ensure files are not executable. (ref: bug #10080)
task :fix_files do
Dir.chdir Dist_Directory do
rm_rf "test", :verbose => true
rm "lib/rvg/to_c.rb", :verbose => true
rm "README.rc", :verbose => true
rm "README.txt", :verbose => true
chmod 0644, FileList["doc/*.html", "doc/ex/*.rb", "doc/ex/images/*", "examples/*.rb"]
end
end
task :manifest do
now = Time.new
now = now.strftime("%H:%M:%S %m/%d/%y")
puts "generating #{MANIFEST}"
Dir.chdir Dist_Directory do
File.open(MANIFEST, "w") do |f|
f.puts "MANIFEST for #{Release} - #{now}\n\n"
Find.find('.') do |name|
next if File.directory? name
f.puts name[2..-1] # remove leading "./"
end
end
end
end
task :export do
sh "cvs -d#{CVSSERVER} export -r #{CVS_Tag} -d #{Dist_Directory} RMagick"
end
task :collateral => [README, :gemspec, :extconf, :doc]
GEM = Dist_Directory.downcase + ".gem"
task :default => [:export, :collateral, :fix_files, :manifest] do
sh "tar czf #{Release}.tar.gz #{Dist_Directory}"
sh "tar cjf #{Release}.tar.bz2 #{Dist_Directory}"
sh "tar c #{Release} | 7z a -t7z -m0=lzma -mx=9 -mfb=64 -ms=on -si#{Release}.tar #{Release}.tar.lzma"
# Extract with
# 7z e RMagick-x.y.z.tar.lzma -so | tar xv
#sh "tar cf #{Release}.tar #{Dist_Directory}"
#sh "7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on #{Release}.tar.lzma #{Release}.tar"
#rm_rf Release+".tar", :verbose => true
Dir.chdir(Dist_Directory) do
sh "gem build rmagick.gemspec"
mv GEM, "../", :verbose => true
end
end
task :clean do
rm_rf Dist_Directory, :verbose => true
rm_rf Release+".tar.gz", :verbose => true
rm_rf Release+".tar.bz2", :verbose => true
rm_rf Release+".tar.lzma", :verbose => true
rm_rf GEM, :verbose => true
end
This diff is collapsed.
This diff is collapsed.
/* Global styles. */
a:link {
text-decoration: none;
}
a:visited {
color: #7F7FFF;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
color: white;
background-color: blue;
text-decoration: underline;
}
body {
background-color: white;
color: black;
font-size: 100.01%;
}
img {
display: block;
border-width: 0;
}
h1 {
background-color: #900;
font-size: x-large;
font-weight: bold;
color: #ebebeb;
padding: .3em 5px .5em 5px;
margin: 0 0;
}
h6#header {
padding-top: 0.5em;
font-size: small;
font-weight: bold;
color: #545454;
letter-spacing: .5em;
text-align: center;
margin: 0 0;
}
/*
* Table of Contents styles
*/
#toc h2 {
background-color: #545454;
color: white;
padding: 5px .3em .3em .3em;
margin: 0 0;
}
#toc h3 {
clear: both;
padding-left: 5px;
padding-right: 1em;
border-bottom: thin solid black;
}
#toc ul {
list-style: none;
}
.toccol {
float: left;
width: 33%;
}
/*
* Navigation bar. Appears at both top and bottom.
*/
div.nav {
clear: both;
background-color: #900;
color: white;
font-size: 8pt;
font-family: sans-serif;
font-weight: bold;
margin-bottom: 0;
margin-top: 1em; /* Separate from header at the top and */
/* from the last element at the bottom */
padding: 2px;
padding-left: 8px;
padding-right: 8px;
text-align: right;
}
div.nav a:link {
text-decoration: none;
color: white;
}
div.nav a:visited {
text-decoration: none;
color: white;
}
div.nav a:hover {
background-color: white;
color: #900;
}
div.nav a:active {
text-decoration: none;
color: white;
}
span.superclass {
font-size: normal;
font-weight: normal;
}
span.mixin {
font-size: smaller;
padding-left: 1em;
}
/*
* Method signatures, descriptions
*/
h2.methods { /* "class methods" */
margin-top: 2em;
margin-bottom: 0;
padding: .5em 5px .5em 5px;
background-color: #663;
color: white;
clear: both;
}
/*
* Method signatures
*/
div.sig {
margin-bottom: .5em;
}
.sig h3 { /* method name: total width 210px */
background-color: #c0c0c0;
color: #000;
width: 225px;
float: left;
padding-left: 5px;
margin-top: 0;
}
.sig p {
background-color: #c0c0c0;
color: #000;
padding-right: 5px;
padding-left: 230px;
padding-bottom: 1em;
margin-top: 0;
}
/*
* Method descriptions
*/
.desc {
margin-left: 235px;
margin-bottom: 2em;
}
.desc h4 {
position: relative;
left: -235px;
padding-left: 5px;
background-image: url(../ex/images/graydient230x6.gif);
background-repeat: repeat-y;
color: black;
font-weight: normal;
font-size: small;
padding-bottom: 0;
margin-bottom: 0;
margin-top: 0;
}
.desc dl,p,pre,img,ul {
margin-top: 0;
}
.desc dt {
font-style: italic;
/* display: compact; */
}
.arg {
font-style: italic;
}
/*
* The next 2 styles are for example scripts.
*/
.example, .desc pre {
padding: 0 .5em 1em .5em; /* Tell Konq to not pad at the top. */
padd\ing-top: 1em; /* Tell everybody else to use 1em padding at the top. */
background-color: #f8f8f8;
border-left: thin dotted black;
border-top: thin dotted black;
border-bottom: 4px solid #c0c0c0;
border-right: 4px solid #c0c0c0
}
.example {
margin-left: 100px;
margin-right: 100px;
margin-bottom: 1em;
}
.example_cutline {
margin-left: 100px;
margin-right: 100px;
font-style: italic;
}
/*
* The following three styles govern the display of example
* images with rollover effects and the "spin" image that
* accompanies them.
*/
/*
* This <p> encloses example images and the spin image.
*/
p.rollover {
position: relative;
}
/*
* Neither the example image nor the spin.gif get a border.
*/
.rollover img {
display: inline;
border-width: 0;
}
/*
* The spin.gif image must be positioned at the upper-right
* corner of the example image.
*/
img.spin {
position: absolute;
top: 0;
left: 204px;
}
/*
* Plain small gray tables
*/
.simple_table {
border-collapse: collapse;
border: thin solid black;
background-color: #f8f8f8;
margin-bottom: 1em;
margin-top: 1em;
width: 100%;
}
.simple_table td {
padding: 3px 1em 3px 1em;
}
.simple_table caption {
font-weight: bold;
}
/*
* Miscellaneous styles
*/
/*
* Insert white space between elements when CSS not enabled.
*/
p.spacer {
display: none;
}
/*
* Text quoted from the xMagick doc.
*/
.imquote {
color: #545454;
}
.imquote p, .imquote ul {
margin-left: 100px;
margin-right: 100px;
padding-bottom: 1em;
}
/* Styles for the example script popup */
body {
background:#fffff0;
margin:10px;
}
h1 {
color: #663;
width: 100%;
text-align: center;
}
.bodybox {
background-color:white;
border:1px solid black;
text-align:left;
}
.bodyfloat {
padding:10px;
color:black;
text-align:left;
}
#close {
width: 100%;
text-align: center;
}
a:link {
color:#663;
font-weight:bold;
}
/* Styles for struct.html and rvgref.html */
.subhd h2 { /* Same as h2.methods but different background-color */
margin-top: 2em;
margin-bottom: .5em;
padding: .5em 5px .5em 5px;
background-color: #545454;
color: white;
clear: both;
}
.subhd h3 { /* Same as h2.methods */
margin-top: 0;
margin-bottom: 0;
padding: .5em 5px .5em 5px;
background-color: #663;
color: white;
}
.sig h4, .sig p {
background-color: #c0c0c0;
color: #000;
margin-top: 0;
}
.sig h4 { /* method name: total width 210px */
width: 205px;
float: left;
padding-left: 5px;
font-size: 110%;
}
.sig p {
padding-right: 5px;
padding-bottom: 1em;
}
.desc h5 {
position: relative;
left: -235px;
padding-left: 5px;
background-image: url(../ex/images/graydient230x6.gif);
background-repeat: repeat-y;
color: black;