summaryrefslogtreecommitdiff
path: root/Rakefile
blob: 92cd981fd85c6d0e41b0427834fcfdbc5fc03915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require "rdoc/task"
require "rake/testtask"
require "rubygems/package_task"

require "rubygems"

task :default => [:test]

Rake::TestTask.new do |test|
  test.libs       << "test"
  test.test_files =  [ "test/ts_all.rb"]
  test.verbose    =  true
  test.ruby_opts  << "-w"
end

Rake::RDocTask.new do |rdoc|
  rdoc.rdoc_files.include( "README.rdoc", "INSTALL",
                           "TODO", "Changelog.md",
                           "AUTHORS", "COPYING",
                           "LICENSE", "lib/" )
  rdoc.main     = "README.rdoc"
  rdoc.rdoc_dir = "doc/html"
  rdoc.title    = "HighLine Documentation"
end

desc "Upload current documentation to Rubyforge"
task :upload_docs => [:rdoc] do
  sh "scp -r doc/html/* " +
     "bbazzarrakk@rubyforge.org:/var/www/gforge-projects/highline/doc/"
  sh "scp -r site/* " +
     "bbazzarrakk@rubyforge.org:/var/www/gforge-projects/highline/"
end

load(File.join(File.dirname(__FILE__), "highline.gemspec"))
Gem::PackageTask.new(SPEC) do |package|
  # do nothing:  I just need a gem but this block is required
end

desc "Show library's code statistics"
task :stats do
  require 'code_statistics'
  CodeStatistics.new( ["HighLine", "lib"],
                      ["Functionals", "examples"],
                      ["Units", "test"] ).to_s
end

desc "Add new files to Subversion"
task :add_to_svn do
  sh %Q{svn status | ruby -nae 'system "svn add \#{$F[1]}" if $F[0] == "?"' }
end