-
Notifications
You must be signed in to change notification settings - Fork 15
/
Rakefile
82 lines (71 loc) · 2.16 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
74
75
76
77
78
79
80
81
82
$:.unshift "./lib"
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'locale/version'
#desc "Default Task"
#task :default => [ :test ]
PKG_VERSION = Locale::VERSION
# Run the unit tests
task :test do
Dir.glob("test/test_*.rb").each do |v|
ruby "-Ilib #{v}"
end
end
Rake::RDocTask.new { |rdoc|
begin
allison = `allison --path`.chop
rescue Exception
allison = ""
end
rdoc.rdoc_dir = 'doc'
rdoc.title = "Ruby-Locale library"
rdoc.options << "--line-numbers" << "--inline-source" <<
"--accessor" << "cattr_accessor=object" << "--charset" << "utf-8"
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('ChangeLog')
rdoc.rdoc_files.add('lib')
rdoc.template = allison if allison.size > 0
}
desc "Create gem and tar.gz"
spec = Gem::Specification.new do |s|
s.name = 'locale'
s.version = PKG_VERSION
s.summary = 'Ruby-Locale is the pure ruby library which provides basic APIs for localization.'
s.author = 'Masao Mutoh'
s.email = 'mutomasa at gmail.com'
s.homepage = 'http://locale.rubyforge.org/'
s.rubyforge_project = "locale"
s.files = FileList['**/*'].to_a.select{|v| v !~ /pkg|CVS/}
s.require_path = 'lib'
s.bindir = 'bin'
s.has_rdoc = true
s.description = <<-EOF
Ruby-Locale is the pure ruby library which provides basic APIs for localization.
EOF
end
unless RUBY_PLATFORM =~ /win32/
Rake::PackageTask.new("ruby-locale", PKG_VERSION) do |o|
o.package_files = FileList['**/*'].to_a.select{|v| v !~ /pkg|CVS/}
o.need_tar_gz = true
o.need_zip = false
end
end
Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar_gz = false
p.need_zip = false
end
desc "Publish the release files to RubyForge."
task :release => [ :package ] do
require 'rubyforge'
rubyforge = RubyForge.new
rubyforge.configure
rubyforge.login
rubyforge.add_release("locale", "locale",
PKG_VERSION,
"pkg/locale-#{PKG_VERSION}.gem",
"pkg/ruby-locale-#{PKG_VERSION}.tar.gz")
end