forked from geoffgarside/primehosting
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRakefile
More file actions
57 lines (48 loc) · 1.35 KB
/
Copy pathRakefile
File metadata and controls
57 lines (48 loc) · 1.35 KB
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
require 'rubygems'
require 'rake'
## Configuration
GEM_NAME = "primehosting"
SUMMARY = "Capistrano recipes for deployment to Primehosting accounts"
HOMEPAGE = "http://primehosting.co.uk/"
AUTHORS = ["Geoff Garside"]
EMAIL = "primehosting@geoffgarside.co.uk"
## Obtained settings
require './lib/primehosting/version'
VER = Primehosting::VERSION::STRING
FILES = Dir["lib/**/*.rb", "script/**/*", "spec/**/*.rb",
"README", "LICENCE", "History.txt"]
## Tasks
namespace :gemspec do
desc "Creates the .gemspec file"
task :generate do
File.open("#{GEM_NAME}.gemspec", "w") do |f|
f.write <<-EOF
Gem::Specification.new do |s|
s.name = "#{GEM_NAME}"
s.version = "#{VER}"
s.summary = "#{SUMMARY}"
s.homepage = "#{HOMEPAGE}"
s.rubyforge_project = "#{GEM_NAME}"
s.authors = #{AUTHORS.inspect}
s.email = "#{EMAIL}"
s.files = #{FILES.inspect}
s.has_rdoc = true
s.add_dependency "capistrano", ">= 2.0.0"
s.add_dependency "highline", ">= 1.4.0"
s.extra_rdoc_files = ["README", "History.txt", "LICENCE"]
end
EOF
end
end
desc "Removes the .gemspec file"
task :destroy do
File.unlink("#{GEM_NAME}.gemspec") if File.exists?("#{GEM_NAME}.gemspec")
end
end
task :package do
spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
Gem::Builder.new(spec).build
end
task :clean do
File.unlink("#{GEM_NAME}-#{VER}.gem")
end