admin: get_devices returns observed_state again
[ruby-mogilefs-client.git] / Rakefile
blob1adba470fff91a40f82535c754e33fde45a4f8a6
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 wd = %w(ChangeLog NEWS)
11 wd_ok = true
12 wd.each do |f|
13   next if File.exist?(f) || system("wrongdoc all")
14   wd_ok = false
15   File.open(f, "a") do |fp|
16     fp.puts "`wrongdoc all' failed, #{f} not generated properly"
17   end
18 end
20 warn "install `wrongdoc' gem to generate: #{wd.inspect}" unless wd_ok
22 manifest = "Manifest.txt"
23 if ! File.exist?(manifest) ||
24    File.stat(manifest).mtime < File.stat(RVF).mtime ||
25    File.stat(manifest).mtime < File.stat(__FILE__).mtime
26   system("git ls-files > #{manifest}")
27   File.open(manifest, "a") do |fp|
28     fp.puts "Manifest.txt"
29     fp.puts "ChangeLog"
30     fp.puts "NEWS"
31     fp.puts "lib/mogilefs/version.rb"
32   end
33 end
35 Hoe.spec 'mogilefs-client' do
36   self.rubyforge_name = 'seattlerb'
37   developer 'Eric Wong', 'normalperson@yhbt.net'
38   # developer 'drbrain@segment7.net', 'Eric Hodel'
39   self.readme_file = "README"
40   self.history_file = "NEWS"
41   self.urls = %w(http://bogomips.org/mogilefs-client/)
42   self.description = self.paragraphs_of("README", 1)
43   self.summary = "MogileFS client library for Ruby"
44 end
46 task :fix_perms do
47   IO.popen('git ls-tree -r HEAD^0') do |fp|
48     fp.each_line do |line|
49       mode, type, sha1, path = line.chomp.split(/\s+/)
50       case mode
51       when '100644' then File.chmod(0644, path)
52       when '100755' then File.chmod(0755, path)
53       end
54     end
55   end
56 end