forked from darashi/jpmobile
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
116 lines (99 loc) · 3.26 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/contrib/rubyforgepublisher'
require 'fileutils'
include FileUtils
require File.join(File.dirname(__FILE__), 'lib', 'jpmobile', 'version')
#
AUTHOR = "dara"
EMAIL = "[email protected]"
DESCRIPTION = "A Rails plugin for Japanese mobile-phones"
RUBYFORGE_PROJECT = "jpmobile"
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
BIN_FILES = %w( )
NAME = "jpmobile"
REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
VERS = ENV['VERSION'] || (Jpmobile::VERSION::STRING + (REV ? ".#{REV}" : ""))
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
RDOC_OPTS = ['--quiet', '--title', "jpmobile documentation",
"--opname", "index.html",
"--line-numbers",
"--main", "README.rdoc",
"--inline-source"]
desc "Packages up jpmobile gem."
task :default => [:test, :spec]
task :package => [:clean]
desc 'Default: run unit tests.'
task :default => :test
desc 'Generate documentation for the jpmobile plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = 'Jpmobile'
rdoc.options << '--line-numbers' << '--inline-source' << '-c UTF-8'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('CHANGELOG')
rdoc.rdoc_files.include('lib/**/*.rb')
end
spec =
Gem::Specification.new do |s|
s.name = NAME
s.version = VERS
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = ["README.rdoc", "CHANGELOG"]
s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)/']
s.summary = DESCRIPTION
s.description = DESCRIPTION
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPATH
s.executables = BIN_FILES
s.rubyforge_project = RUBYFORGE_PROJECT
s.bindir = "bin"
s.require_path = "lib"
s.add_runtime_dependency('actionpack', '>=2.2.2')
s.add_development_dependency('rspec', '>=1.1.12')
s.add_development_dependency('rspec-rails', '>=1.1.12')
s.add_development_dependency('rspec-fixture', '>=0.0.2')
s.files = %w(README.rdoc CHANGELOG Rakefile) +
Dir.glob("{bin,doc,test,lib,templates,generator,extras,website,script}/**/*") +
Dir.glob("ext/**/*.{h,c,rb}") +
Dir.glob("examples/**/*.rb") +
Dir.glob("tools/*.rb")
# s.extensions = FileList["ext/**/extconf.rb"].to_a
end
Rake::GemPackageTask.new(spec) do |p|
p.need_tar = true
p.gem_spec = spec
end
task :install do
name = "#{NAME}-#{VERS}.gem"
sh %{rake package}
sh %{sudo gem install pkg/#{name}}
end
task :uninstall => [:clean] do
sh %{sudo gem uninstall #{NAME}}
end
desc "Publish the API documentation"
task :pdoc => [:rdoc] do
sh "rsync -azv --delete doc/ [email protected]:/var/www/gforge-projects/jpmobile/rdoc/"
end
desc "Update misc tables"
task :update do
Dir.glob("tools/update_*.rb").each do |path|
ruby path
end
end
desc "Release helper"
task :rel => [:gem] do
puts "-"*40
puts "rubyforge add_release #{NAME} #{NAME} #{VERS} pkg/#{NAME}-#{VERS}.gem"
puts "git tag #{VERS}"
end
task :test => ['test:legacy', 'spec:unit', 'test:rails']
load 'tasks/jpmobile_tasks.rake'