-
Notifications
You must be signed in to change notification settings - Fork 4
/
Rakefile
63 lines (54 loc) · 1.41 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- Ruby -*-
require 'rake/clean'
require 'rubygems/package_task'
require 'rdoc/task'
require "rake/testtask"
task :default => :test
Rake::RDocTask.new do |t|
t.rdoc_dir = 'rdoc'
t.rdoc_files.include('README.rdoc', 'lib/**/*.rb')
t.options << '--charset' << 'utf-8'
t.template = 'kilmer'
end
Rake::TestTask.new do |t|
t.test_files = FileList["t/test*.rb"]
t.libs << "."
end
begin
require "rcov/rcovtask"
Rcov::RcovTask.new do |t|
t.libs << "."
t.pattern = "t/test*.rb"
end
rescue LoadError
end
spec = Gem::Specification.new do |s|
s.name = "text-hatena"
s.version = "0.12.20080627.0"
s.summary = "A Ruby library for Hatena notation"
s.require_path = 'lib'
s.files = (Dir.glob('{lib,t}/**/*').select{|i|File.file?(i)} + %w(README README.en README.rdoc Rakefile) + ["#{s.name}.gemspec"]).sort
s.has_rdoc = true
s.author = 'Hiroyuki Iwatsuki'
s.email = '[email protected]'
s.homepage = 'http://moonrock.jp/~don/ruby/text-hatena/'
end
Gem::PackageTask.new(spec) do |t|
t.need_tar = true
t.gem_spec = spec
end
desc "Generate gemspec"
task :gemspec do
File.open("#{spec.name}.gemspec", "w") do |f|
f.flock(File::LOCK_EX)
f.write(spec.to_yaml)
end
end
desc "Install #{spec.name}-#{spec.version}"
task :install => :package do
sh %(sudo gem install pkg/#{spec.name}-#{spec.version})
end
desc "Uninstall #{spec.name}"
task :uninstall do
sh %(sudo gem uninstall #{spec.name})
end