Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 29ad20858c
Fetching contributors…

Cannot retrieve contributors at this time

file 44 lines (38 sloc) 1.257 kb
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
#!/usr/bin/env rake

require "rake/testtask"
require "rake/rdoctask"

require "fileutils"

task :default => [:test]

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

Rake::RDocTask.new do |rdoc|
rdoc.main = "README"
rdoc.rdoc_dir = "doc/html"
rdoc.title = "RRDB Documentation"
rdoc.rdoc_files.include( *%w[ README INSTALL CHANGELOG
AUTHORS COPYING LICENSE
lib/ ] )
end

desc "Updates the .gemspec file so GitHub will rebuild it"
task :update_gem do
  version = File.read(
              File.join(File.dirname(__FILE__), *%w[lib rrdb.rb])
            )[/^\s*VERSION\s*=\s*(['"])(\d\.\d\.\d)\1/, 2]
  open("rrdb.gemspec") do |old_spec|
    open("new_rrdb.gemspec", "w") do |new_spec|
      old_spec.each do |line|
        if line =~ /\A(\s*s\.version\s*=\s*)(["'])\d\.\d\.\d\2\s*\z/
          new_spec.puts %Q{#{$1}"#{version}"}
        elsif line =~ /\A(\s*s\.files\s*=\s*)/
          new_spec.puts %Q{#{$1}%w[#{Dir["{lib,test}/**/*.rb"].join(" ")}] + %w[Rakefile setup.rb]}
        else
          new_spec.puts line
        end
      end
    end
  end
  FileUtils.mv("new_rrdb.gemspec", "rrdb.gemspec")
end
Something went wrong with that request. Please try again.