-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
37 lines (32 loc) · 1.32 KB
/
Rakefile
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
33
34
35
36
37
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'ext' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
# i don't use jeweler.
task :gemspec do
files = Dir["ext/**/*.{cc,c,mak,h}"] + Dir["{ext,test}/*.rb"] + %w(ext/libstemmer_c/Makefile README.rdoc)
gemspec =<<-RUBY
Gem::Specification.new do |s|
s.name = "chipper"
s.version = "__VERSION__"
s.date = "__DATE__"
s.authors = ["Bharanee Rathna", "John Barratt"]
s.email = ["[email protected]", "[email protected]"]
s.summary = "twitter text extractor"
s.description = "twitter text extraction utilities"
s.homepage = "http://github.com/deepfryed/chipper"
s.files = __FILES__
s.extra_rdoc_files = %w(README.rdoc)
s.extensions = %w(ext/extconf.rb)
s.require_paths = %w(lib)
end
RUBY
gemspec.sub! /__VERSION__/, File.read(File.join(File.dirname(__FILE__), 'ext/src/version.h')).scan(/[\d.]+/).first
gemspec.sub! /__DATE__/, Time.now.strftime("%F")
gemspec.sub! /__FILES__/, ('[%s]' % files.map(&:inspect).join(', '))
gemspec.gsub! /^\s{4}/m, ''
File.open('chipper.gemspec', 'w') {|fh| fh.write(gemspec)}
end
task :default => :test