forked from jmettraux/rufus-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
111 lines (78 loc) · 1.85 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
require 'rubygems'
require 'fileutils'
require 'rake'
require 'rake/clean'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/testtask'
#require 'rake/rdoctask'
require 'hanna/rdoctask'
gemspec = File.read('rufus-scheduler.gemspec')
eval "gemspec = #{gemspec}"
#
# tasks
CLEAN.include('pkg', 'tmp', 'html')
task :default => [ :clean, :repackage ]
#
# SPECING
task :spec do
load File.dirname(__FILE__) + '/spec/spec.rb'
end
#
# TESTING
task :test => :spec
#
# VERSION
task :change_version do
version = ARGV.pop
`sedip "s/VERSION = '.*'/VERSION = '#{version}'/" lib/rufus/sc/scheduler.rb`
`sedip "s/s.version = '.*'/s.version = '#{version}'/" rufus-scheduler.gemspec`
exit 0 # prevent rake from triggering other tasks
end
#
# PACKAGING
Rake::GemPackageTask.new(gemspec) do |pkg|
#pkg.need_tar = true
end
Rake::PackageTask.new('rufus-scheduler', gemspec.version) do |pkg|
pkg.need_zip = true
pkg.package_files = FileList[
'Rakefile',
'*.txt',
'lib/**/*',
'spec/**/*',
'test/**/*'
].to_a
#pkg.package_files.delete("MISC.txt")
class << pkg
def package_name
"#{@name}-#{@version}-src"
end
end
end
#
# DOCUMENTATION
Rake::RDocTask.new do |rd|
rd.main = 'README.rdoc'
rd.rdoc_dir = 'html/rufus-scheduler'
rd.rdoc_files.include(
'README.rdoc',
'CHANGELOG.txt',
'LICENSE.txt',
'CREDITS.txt',
'lib/**/*.rb')
#rd.rdoc_files.exclude('lib/tokyotyrant.rb')
rd.title = 'rufus-scheduler rdoc'
rd.options << '-N' # line numbers
rd.options << '-S' # inline source
end
task :rrdoc => :rdoc do
FileUtils.cp('doc/rdoc-style.css', 'html/rufus-scheduler/')
end
#
# WEBSITE
task :upload_website => [ :clean, :rrdoc ] do
account = 'jmettraux@rubyforge.org'
webdir = '/var/www/gforge-projects/rufus'
sh "rsync -azv -e ssh html/rufus-scheduler-em #{account}:#{webdir}/"
end