list_keys raises on errors properly
[ruby-mogilefs-client.git] / Rakefile
blob3ade063c694986b9ecd486072bda354f0afebee4
1 require 'rubygems'
2 require 'hoe'
3 load "./GIT-VERSION-GEN"
5 include Rake::DSL if defined?(Rake::DSL)
6 $:.unshift 'lib'
7 require 'mogilefs'
8 Hoe.plugin :seattlerb
10 if ! File.exist?("ChangeLog") || ! File.exist?("NEWS")
11   system("wrongdoc all")
12 end
14 manifest = "Manifest.txt"
15 if ! File.exist?(manifest) ||
16    File.stat(manifest).mtime < File.stat(RVF).mtime ||
17    File.stat(manifest).mtime < File.stat(__FILE__).mtime
18   system("git ls-files > #{manifest}")
19   File.open(manifest, "a") do |fp|
20     fp.puts "Manifest.txt"
21     fp.puts "ChangeLog"
22     fp.puts "NEWS"
23     fp.puts "lib/mogilefs/version.rb"
24   end
25 end
27 Hoe.spec 'mogilefs-client' do
28   self.rubyforge_name = 'seattlerb'
29   developer 'Eric Wong', 'normalperson@yhbt.net'
30   # developer 'drbrain@segment7.net', 'Eric Hodel'
31   self.readme_file = "README"
32   self.history_file = "NEWS"
33   self.url = "http://bogomips.org/mogilefs-client"
34   self.description = self.paragraphs_of("README", 1)
35   self.summary = "MogileFS client library for Ruby"
36 end
38 task :fix_perms do
39   IO.popen('git ls-tree -r HEAD^0') do |fp|
40     fp.each_line do |line|
41       mode, type, sha1, path = line.chomp.split(/\s+/)
42       case mode
43       when '100644' then File.chmod(0644, path)
44       when '100755' then File.chmod(0755, path)
45       end
46     end
47   end
48 end