-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
65 lines (55 loc) · 1.59 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
require 'rubygems'
require 'rake/gempackagetask'
require 'spec/rake/spectask'
require 'rake/rdoctask'
require 'rake/clean'
GEM = "rightcert"
VER = "0.3.0"
AUTHOR = "RightScale"
EMAIL = "[email protected]"
HOMEPAGE = "http://github.com/rightscale/right_cert/tree/master"
SUMMARY = "Secure serialization using X.509 Certificates for digital signatures and encryption"
Dir.glob('tasks/*.rake').each { |r| Rake.application.add_import r }
task :default => [ :spec, :gem ]
spec = Gem::Specification.new do |s|
s.name = GEM
s.version = ::VER
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = ["README.rdoc"]
s.summary = SUMMARY
s.description = s.summary
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPAGE
s.require_path = 'lib'
s.files = %w(README.rdoc Rakefile) + Dir.glob("{lib,bin,specs}/**/*")
end
Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
task :install => [:package] do
sh %{sudo gem install pkg/#{GEM}-#{VER}}
end
desc "Run unit specs"
Spec::Rake::SpecTask.new do |t|
t.spec_opts = ["--format", "specdoc", "--colour"]
t.spec_files = FileList["spec/**/*_spec.rb"]
end
desc 'Generate RDoc documentation'
Rake::RDocTask.new do |rd|
rd.title = spec.name
rd.rdoc_dir = 'rdoc'
rd.main = "README.rdoc"
rd.rdoc_files.include("lib/**/*.rb", *spec.extra_rdoc_files)
end
CLOBBER.include(:clobber_rdoc)
desc 'Generate and open documentation'
task :docs => :rdoc do
case RUBY_PLATFORM
when /darwin/ ; sh 'open rdoc/index.html'
when /mswin|mingw/ ; sh 'start rdoc\index.html'
else
sh 'firefox rdoc/index.html'
end
end