Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 46 lines (39 sloc) 1.28 kb
8555973 @JEG2 Adding configuration support.
authored
1 #!/usr/bin/env rake
2
3 require "rake/testtask"
2cbfc46 @JEG2 Documentation and gem specification.
authored
4 require "rake/rdoctask"
8555973 @JEG2 Adding configuration support.
authored
5
29ad208 @JEG2 Making gemspec safe.
authored
6 require "fileutils"
7
8555973 @JEG2 Adding configuration support.
authored
8 task :default => [:test]
9
10 Rake::TestTask.new do |test|
11 test.libs << "test"
12 test.test_files = %w[test/ts_all.rb]
13 test.verbose = true
14 end
2cbfc46 @JEG2 Documentation and gem specification.
authored
15
16 Rake::RDocTask.new do |rdoc|
17 rdoc.main = "README"
18 rdoc.rdoc_dir = "doc/html"
19 rdoc.title = "RRDB Documentation"
20 rdoc.rdoc_files.include( *%w[ README INSTALL CHANGELOG
21 AUTHORS COPYING LICENSE
22 lib/ ] )
23 end
29ad208 @JEG2 Making gemspec safe.
authored
24
25 desc "Updates the .gemspec file so GitHub will rebuild it"
26 task :update_gem do
27 version = File.read(
28 File.join(File.dirname(__FILE__), *%w[lib rrdb.rb])
29 )[/^\s*VERSION\s*=\s*(['"])(\d\.\d\.\d)\1/, 2]
30 open("rrdb.gemspec") do |old_spec|
31 open("new_rrdb.gemspec", "w") do |new_spec|
32 old_spec.each do |line|
33 if line =~ /\A(\s*s\.version\s*=\s*)(["'])\d\.\d\.\d\2\s*\z/
34 new_spec.puts %Q{#{$1}"#{version}"}
35 elsif line =~ /\A(\s*s\.files\s*=\s*)/
fae1f14 @JEG2 Minor fixes.
authored
36 new_spec.puts %Q{#{$1}%w[#{Dir["{lib,test}/**/*.rb"].join(" ")} } +
37 "Rakefile setup.rb]"
29ad208 @JEG2 Making gemspec safe.
authored
38 else
39 new_spec.puts line
40 end
41 end
42 end
43 end
44 FileUtils.mv("new_rrdb.gemspec", "rrdb.gemspec")
45 end
Something went wrong with that request. Please try again.