Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 121 lines (92 sloc) 3.859 kB
09608b8 initial checkin
a2800276 authored
1 require "rake/rdoctask"
2 require "rake/gempackagetask"
3 require "rake/testtask"
4 require "rake/clean"
5 require "rubygems"
6
7 require "lib/simple_http"
8
9 # Specifies the default task to execute. This is often the "test" task
10 # and we'll change things around as soon as we have some tests.
11
12 task :default => [:rdoc]
13
14 # The directory to generate +rdoc+ in.
15 RDOC_DIR="doc/html"
16
17 # This global variable contains files that will be erased by the `clean` task.
18 # The `clean` task itself is automatically generated by requiring `rake/clean`.
19
20 CLEAN << RDOC_DIR
21
22
23 # This is the task that generates the +rdoc+ documentation from the
24 # source files. Instantiating Rake::RDocTask automatically generates a
25 # task called `rdoc`.
26
27 Rake::RDocTask.new do |rd|
28 # Options for documenation generation are specified inside of
29 # this block. For example the following line specifies that the
30 # content of the README file should be the main page of the
31 # documenation.
32 rd.main = "README"
33
34 # The following line specifies all the files to extract
35 # documenation from.
36 rd.rdoc_files.include( "README", "AUTHORS", "LICENSE", "TODO",
37 "CHANGELOG", "bin/**/*", "lib/**/*.rb",
38 "examples/**/*rb","test/**/*.rb", "doc/*.rdoc")
39 # This one specifies the output directory ...
40 rd.rdoc_dir = "doc/html"
41
42 # Or the HTML title of the generated documentation set.
43 rd.title = "simple_http: Simple Http client lib."
44
45 # These are options specifiying how source code inlined in the
46 # documentation should be formatted.
47
48 rd.options = ["--line-numbers", "--inline-source"]
49
50 # Check:
51 # `rdoc --help` for more rdoc options
52 # the {rdoc documenation home}[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html]
53 # or the documentation for the +Rake::RDocTask+ task[http://rake.rubyforge.org/classes/Rake/RDocTask.html]
54 end
55
56 # The GemPackageTask facilitates getting all your files collected
57 # together into gem archives. You can also use it to generate tarball
58 # and zip archives.
59
60 # First you'll need to assemble a gemspec
61
62 PROJECT_NAME = "simplehttp"
63 PKG_VERSION = SimpleHttp::VERSION
64 PKG_FILES = FileList['lib/**/*.rb', 'bin/**/*', 'examples/**/*', '[A-Z]*', 'test/**/*'].to_a
65
66 spec = Gem::Specification.new do |s|
67 s.platform = Gem::Platform::RUBY
68 s.summary = "simple_http: Simple Http client lib."
69 s.name = PROJECT_NAME
70 s.version = PKG_VERSION
71 s.files = PKG_FILES
72 s.requirements << "none"
73 s.require_path = 'lib'
74 s.description = <<END_DESC
75 Wrapper around net/http to provide quick and dirty http access.
76 END_DESC
77 end
78
79 # Adding a new GemPackageTask adds a task named `package`, which generates
80 # packages as gems, tarball and zip archives.
81 Rake::GemPackageTask.new(spec) do |pkg|
82 pkg.need_zip = true
83 pkg.need_tar_gz = true
84 end
85
86
87 # This task is used to demonstrate how to upload files to Rubyforge.
88 # Calling `upload_page` creates a current version of the +rdoc+
89 # documentation and uploads it to the Rubyforge homepage of the project,
90 # assuming it's hosted there and naming conventions haven't changed.
91 #
92 # This task uses `sh` to call the `scp` binary, which is plattform
93 # dependant and may not be installed on your computer if you're using
94 # Windows. I'm currently not aware of any pure ruby way to do scp
95 # transfers.
96
97 RubyForgeUser="a2800276"
98 RubyForgeProject=PROJECT_NAME
99
100 desc "Upload the web pages to the web."
dbc80a4 corrected small error in Rakefile
a2800276 authored
101 task :upload_pages => ["clean", :rdoc] do
09608b8 initial checkin
a2800276 authored
102 if RubyForgeProject then
103 path = "/var/www/gforge-projects/#{RubyForgeProject}"
104 sh "scp -r doc/html/* #{RubyForgeUser}@rubyforge.org:#{path}"
105 sh "scp doc/images/*.png #{RubyForgeUser}@rubyforge.org:#{path}/images"
106 end
107 end
108
109
110 # This task will run the unit tests provided in files called
111 # `test/test*.rb`. The task itself can be run with a call to `rake test`
112
113 Rake::TestTask.new do |t|
114 t.libs << "test"
115 t.libs << "lib"
116 t.test_files = FileList['test/*.rb']
117 t.verbose = true
118 end
119
120
Something went wrong with that request. Please try again.