Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 78 lines (66 sloc) 1.938 kB
a548e49 Initial checkin.
codahale authored
1 gem "rspec"
2 require "spec/rake/spectask"
3 require 'rake/gempackagetask'
4 require 'rake/contrib/rubyforgepublisher'
5 require 'rake/clean'
6 require 'rake/rdoctask'
7
8 PKG_NAME = "bcrypt-ruby"
9 PKG_VERSION = "1.0.0"
10 PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
11 PKG_FILES = FileList[
12 '[A-Z]*',
13 'lib/**/*.rb',
14 'spec/**/*.rb',
15 'ext/*.c',
16 'ext/*.h',
17 'ext/*.rb'
18 ]
19
20 task :default => [:spec]
21
22 desc "Run all specs"
23 Spec::Rake::SpecTask.new do |t|
24 t.spec_files = FileList['spec/**/*_spec.rb']
25 t.spec_opts = ['--color','--backtrace','--diff']
26 t.rcov = true
27 t.rcov_dir = 'doc/output/coverage'
28 t.rcov_opts = ['--exclude', 'spec\/spec,spec\/.*_spec.rb']
29 end
30
31 desc "Run all specs and store html output in doc/output/report.html"
32 Spec::Rake::SpecTask.new('spec_html') do |t|
33 t.spec_files = FileList['spec/**/*_spec.rb']
34 t.spec_opts = ['--diff','--format html','--backtrace','--out doc/output/report.html']
35 end
36
37 desc 'Generate RDoc'
38 rd = Rake::RDocTask.new do |rdoc|
39 rdoc.rdoc_dir = 'doc/output/rdoc'
40 rdoc.options << '--title' << 'bcrypt-ruby' << '--line-numbers' << '--inline-source' << '--main' << 'README'
41 rdoc.template = ENV['TEMPLATE'] if ENV['TEMPLATE']
42 rdoc.rdoc_files.include('README', 'COPYING', 'lib/**/*.rb')
43 end
44
45 spec = Gem::Specification.new do |s|
46 s.name = PKG_NAME
47 s.version = PKG_VERSION
48 s.summary = "Blah."
49 s.description = <<-EOF
50 Woot.
51 EOF
52
53 s.files = PKG_FILES.to_a
54 s.require_path = 'lib'
55
56 s.has_rdoc = true
57 s.rdoc_options = rd.options
58 s.extra_rdoc_files = rd.rdoc_files.to_a
59
60 s.extensions = FileList["ext/extconf.rb"].to_a
61
62 s.autorequire = 'bcrypt'
63 s.author = ["Coda Hale"]
64 s.email = "coda.hale@gmail.com"
65 s.homepage = "http://bcrypt-ruby.rubyforge.org"
66 s.rubyforge_project = "bcrypt-ruby"
67 end
68
69 Rake::GemPackageTask.new(spec) do |pkg|
70 pkg.need_zip = true
71 pkg.need_tar = true
72 end
73
74 task :compile do
75 Dir.chdir('./ext')
76 system "ruby extconf.rb"
77 system "make"
78 end
Something went wrong with that request. Please try again.