forked from pboling/cacheable-flash
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
63 lines (54 loc) · 1.46 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
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'fileutils'
include FileUtils
PKG_VERSION = "0.1.5"
desc 'Default: run specs.'
task :default => :spec
desc 'Test the cacheable_flash plugin.'
Rake::TestTask.new(:spec) do |t|
t.libs << 'lib'
t.pattern = 'spec/**/*_spec.rb'
t.verbose = true
end
desc 'Generate documentation for the cacheable_flash plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'CacheableFlash'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
end
desc 'Tag the current release'
task(:tag_release) {tag_release}
desc 'Package the release as a tarball'
task(:pkg) {package_release}
def tag_release
user = ENV['USER'] || nil
user_part = user ? "#{user}@" : ""
svn_path = "svn+ssh://#{user_part}rubyforge.org/var/svn/pivotalrb/cacheable_flash"
`svn cp #{svn_path}/trunk #{svn_path}/tags/REL-#{dashed_version} -m 'Version #{PKG_VERSION}'`
end
def package_release
dir = File.dirname(__FILE__)
mkdir_p "#{dir}/pkg"
files = [
"README.rdoc",
"CHANGES",
"init.rb",
"install.rb",
"uninstall.rb",
"lib",
"javascripts",
"tasks",
"spec",
]
files = files.collect { |f| "cacheable_flash/#{f}" }
Dir.chdir("#{dir}/..") do
`tar zcvf cacheable_flash/pkg/cacheable_flash-#{dashed_version}.tgz #{files.join(' ')}`
end
end
def dashed_version
PKG_VERSION.gsub('.', '-')
end