public
Description: Sexy Charts using Google API & Ruby
Homepage: http://googlecharts.rubyforge.org/
Clone URL: git://github.com/mattetti/googlecharts.git
mattetti (author)
Mon Jun 22 12:07:05 -0700 2009
commit  799a787d2eced4075bf77fdf57656f5eb531511f
tree    a5f2a37e38c5cd55799f2e580663b5862459e5af
parent  e7440c2d59441340d5d656acd3be443454235ce0
googlecharts / Rakefile
100644 32 lines (27 sloc) 1.103 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
require 'config/requirements'
require 'config/hoe' # setup Hoe + all gem configuration
 
Dir['tasks/**/*.rake'].each { |rake| load rake }
 
desc %{Update ".manifest" with the latest list of project filenames. Respect\
.gitignore by excluding everything that git ignores. Update `files` and\
`test_files` arrays in "*.gemspec" file if it's present.}
task :manifest do
  list = Dir['**/*'].sort
  spec_file = Dir['*.gemspec'].first
  list -= [spec_file] if spec_file
  
  File.read('.gitignore').each_line do |glob|
    glob = glob.chomp.sub(/^\//, '')
    list -= Dir[glob]
    list -= Dir["#{glob}/**/*"] if File.directory?(glob) and !File.symlink?(glob)
    puts "excluding #{glob}"
  end
 
  if spec_file
    spec = File.read spec_file
    spec.gsub! /^(\s* s.(test_)?files \s* = \s* )( \[ [^\]]* \] | %w\( [^)]* \) )/mx do
      assignment = $1
      bunch = $2 ? list.grep(/^test\//) : list
      '%s%%w(%s)' % [assignment, bunch.join(' ')]
    end
      
    File.open(spec_file, 'w') {|f| f << spec }
  end
  File.open('.manifest', 'w') {|f| f << list.join("\n") }
end