Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
121 lines (92 sloc) 3.77 KB
require "rake/rdoctask"
require "rake/gempackagetask"
require "rake/testtask"
require "rake/clean"
require "rubygems"
require "lib/simple_http"
# Specifies the default task to execute. This is often the "test" task
# and we'll change things around as soon as we have some tests.
task :default => [:rdoc]
# The directory to generate +rdoc+ in.
# This global variable contains files that will be erased by the `clean` task.
# The `clean` task itself is automatically generated by requiring `rake/clean`.
# This is the task that generates the +rdoc+ documentation from the
# source files. Instantiating Rake::RDocTask automatically generates a
# task called `rdoc`. do |rd|
# Options for documenation generation are specified inside of
# this block. For example the following line specifies that the
# content of the README file should be the main page of the
# documenation.
rd.main = "README"
# The following line specifies all the files to extract
# documenation from.
rd.rdoc_files.include( "README", "AUTHORS", "LICENSE", "TODO",
"CHANGELOG", "bin/**/*", "lib/**/*.rb",
"examples/**/*rb","test/**/*.rb", "doc/*.rdoc")
# This one specifies the output directory ...
rd.rdoc_dir = "doc/html"
# Or the HTML title of the generated documentation set.
rd.title = "simple_http: Simple Http client lib."
# These are options specifiying how source code inlined in the
# documentation should be formatted.
rd.options = ["--line-numbers", "--inline-source"]
# Check:
# `rdoc --help` for more rdoc options
# the {rdoc documenation home}[]
# or the documentation for the +Rake::RDocTask+ task[]
# The GemPackageTask facilitates getting all your files collected
# together into gem archives. You can also use it to generate tarball
# and zip archives.
# First you'll need to assemble a gemspec
PROJECT_NAME = "simplehttp"
PKG_FILES = FileList['lib/**/*.rb', 'bin/**/*', 'examples/**/*', '[A-Z]*', 'test/**/*'].to_a
spec = do |s|
s.platform = Gem::Platform::RUBY
s.summary = "simple_http: Simple Http client lib." = PROJECT_NAME
s.version = PKG_VERSION
s.files = PKG_FILES
s.requirements << "none"
s.require_path = 'lib'
s.description = <<END_DESC
Wrapper around net/http to provide quick and dirty http access.
# Adding a new GemPackageTask adds a task named `package`, which generates
# packages as gems, tarball and zip archives. do |pkg|
pkg.need_zip = true
pkg.need_tar_gz = true
# This task is used to demonstrate how to upload files to Rubyforge.
# Calling `upload_page` creates a current version of the +rdoc+
# documentation and uploads it to the Rubyforge homepage of the project,
# assuming it's hosted there and naming conventions haven't changed.
# This task uses `sh` to call the `scp` binary, which is plattform
# dependant and may not be installed on your computer if you're using
# Windows. I'm currently not aware of any pure ruby way to do scp
# transfers.
desc "Upload the web pages to the web."
task :upload_pages => ["clean", :rdoc] do
if RubyForgeProject then
path = "/var/www/gforge-projects/#{RubyForgeProject}"
sh "scp -r doc/html/* #{RubyForgeUser}{path}"
sh "scp doc/images/*.png #{RubyForgeUser}{path}/images"
# This task will run the unit tests provided in files called
# `test/test*.rb`. The task itself can be run with a call to `rake test` do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/*.rb']
t.verbose = true