-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
73 lines (63 loc) · 2.13 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
64
65
66
67
68
69
70
71
72
73
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/contrib/rubyforgepublisher'
require 'rubyforge'
SPEC = Gem::Specification.new do |s|
s.name = "wrtranslate"
s.version = "0.2"
s.author = "Martin Catty"
s.email = "martin@noremember.org"
s.homepage = "http://github.com/fuse/translate"
s.rubyforge_project = "wrtranslate"
s.summary = "translate provide an easy way to translate word or expression using wordreference.com"
s.description = "translate make get requests and parse the result using hpricot. You can use it inside an other program or directly via command line."
s.files = [ "Rakefile", "install.rb", "uninstall.rb", "README", "LICENCE" ] +
Dir.glob("{bin,doc,lib,test}/**/*")
s.bindir = "bin"
s.require_path = "lib"
s.test_files = "test/translate_test.rb"
s.has_rdoc = true
s.extra_rdoc_files = ["README"]
s.executables = "translate"
s.add_dependency("hpricot")
end
desc 'Run all tests by default'
task :default => :test
task :gem
Rake::GemPackageTask.new(SPEC) do |pkg|
pkg.need_zip = true
pkg.need_tar_bz2 = true
end
desc "Install the application"
task :install do
ruby "install.rb"
end
desc "Publish documentation to RubyForge"
task :publish_doc => [:rdoc] do
rf = Rake::RubyForgePublisher.new(SPEC.rubyforge_project, 'fuse')
rf.upload
puts "Published documentation to RubyForge"
end
desc "Release gem #{SPEC.name}-#{SPEC.version}.gem"
task :release => [:gem, :publish_doc] do
rf = RubyForge.new.configure
puts "Logging in"
rf.login
puts "Releasing #{SPEC.name} v.#{SPEC.version}"
files = Dir.glob('pkg/*.{zip,bz2,gem}')
rf.add_release SPEC.rubyforge_project, SPEC.rubyforge_project, SPEC.version, *files
end
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.title = 'Translate'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.options << '--charset' << 'utf-8'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end