This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
/
Rakefile
95 lines (78 loc) · 2.89 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
require "rubygems"
require "rake/rdoctask"
require File.join(File.dirname(__FILE__), *%w[lib clickatell version])
begin
require 'jeweler'
Jeweler::Tasks.new do |gemspec|
gemspec.name = "clickatell"
gemspec.summary = "Ruby interface to the Clickatell SMS gateway service."
gemspec.email = "[email protected]"
gemspec.homepage = "http://clickatell.rubyforge.org"
gemspec.authors = ["Luke Redpath"]
gemspec.executables = %w{sms}
gemspec.extra_rdoc_files = %w{RDOC_README.txt History.txt License.txt}
gemspec.has_rdoc = true
gemspec.rdoc_options = %w{--main RDOC_README.txt}
gemspec.version = Clickatell::VERSION
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler not available. Install it with: gem install jeweler"
end
task :default => :spec
require "spec"
require "spec/rake/spectask"
Spec::Rake::SpecTask.new do |t|
t.spec_opts = %w(--format specdoc --colour)
t.libs = ["spec"]
end
Spec::Rake::SpecTask.new("spec_html") do |t|
t.spec_opts = %w(--format html)
t.libs = ["spec"]
end
# Rake::RDocTask.new do |rd|
# rd.main = "RDOC_README.txt"
# rd.rdoc_files.include("lib/**/*.rb", *$gemspec.extra_rdoc_files)
# rd.rdoc_dir = "rdoc"
# end
desc 'Generate website files'
task :website do
Dir['website/**/*.txt'].each do |txt|
sh %{ ruby scripts/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
end
sh "rake -s spec_html > website/specs.html"
end
desc 'Clear out RDoc and generated packages'
task :clean => [:clobber_rdoc, :clobber_package]
begin
require "rake/contrib/sshpublisher"
namespace :rubyforge do
desc "Release gem and RDoc documentation to RubyForge"
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
namespace :release do
desc "Release a new version of this gem"
task :gem => [:package] do
require 'rubyforge'
rubyforge = RubyForge.new
rubyforge.configure
rubyforge.login
rubyforge.userconfig['release_notes'] = $gemspec.summary
path_to_gem = File.join(File.dirname(__FILE__), "pkg", "#{$gemspec.name}-#{$gemspec.version}.gem")
puts "Publishing #{$gemspec.name}-#{$gemspec.version.to_s} to Rubyforge..."
rubyforge.add_release($gemspec.rubyforge_project, $gemspec.name, $gemspec.version.to_s, path_to_gem)
end
desc "Publish RDoc to RubyForge."
task :docs => [:rdoc, :website] do
config = YAML.load(
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
)
host = "#{config['username']}@rubyforge.org"
remote_dir = "/var/www/gforge-projects/clickatell/"
Rake::SshDirPublisher.new(host, remote_dir, 'website').upload
Rake::SshDirPublisher.new(host, File.join(remote_dir, 'rdoc'), 'rdoc').upload
end
end
end
rescue LoadError
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
end