-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathRakefile
More file actions
23 lines (20 loc) · 700 Bytes
/
Copy pathRakefile
File metadata and controls
23 lines (20 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'rake'
desc "install gem"
task :install_gem do
puts `gem build fakebook.gemspec && sudo gem install fakebook*.gem --no-rdoc --no-ri && rm fakebook*.gem`
end
desc "update gemspec with latest file list, because github can't deal with File.glob tricks"
task :manifest do
list = Dir['**/*'].sort
spec_file = Dir['*.gemspec'].first
list -= [spec_file] if spec_file
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
end