Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 123 lines (107 sloc) 3.184 kb
a548e49b » codahale
2007-02-27 Initial checkin.
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'
51520c43 » codahale
2007-03-08 Fixed cleaning and clobbering, added benchmark task, removed doc dire…
7 require "benchmark"
a548e49b » codahale
2007-02-27 Initial checkin.
8
9 PKG_NAME = "bcrypt-ruby"
3137ad6d »
2009-03-11 Prepare for the 2.0.5 release.
10 PKG_VERSION = "2.0.5"
a548e49b » codahale
2007-02-27 Initial checkin.
11 PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12 PKG_FILES = FileList[
13 '[A-Z]*',
14 'lib/**/*.rb',
15 'spec/**/*.rb',
16 'ext/*.c',
17 'ext/*.h',
8f7acf49 » FooBarWidget
2009-08-05 Finish JRuby support.
18 'ext/*.rb',
19 'ext/jruby/bcrypt_jruby/BCrypt.java',
20 'ext/jruby/bcrypt_jruby/BCrypt.class'
a548e49b » codahale
2007-02-27 Initial checkin.
21 ]
51520c43 » codahale
2007-03-08 Fixed cleaning and clobbering, added benchmark task, removed doc dire…
22 CLEAN.include(
23 "ext/*.o",
24 "ext/*.bundle",
25 "ext/*.so"
26 )
27 CLOBBER.include(
46003605 » codahale
2007-03-08 Updated changelog with full details of what's been changed.
28 "doc/coverage"
51520c43 » codahale
2007-03-08 Fixed cleaning and clobbering, added benchmark task, removed doc dire…
29 )
a548e49b » codahale
2007-02-27 Initial checkin.
30
20201141 »
2008-05-07 Make rake compile behave better, make the default task a full recompi…
31 task :default => [:compile, :spec]
a548e49b » codahale
2007-02-27 Initial checkin.
32
33 desc "Run all specs"
34 Spec::Rake::SpecTask.new do |t|
35 t.spec_files = FileList['spec/**/*_spec.rb']
36 t.spec_opts = ['--color','--backtrace','--diff']
fb7906cd » FooBarWidget
2009-08-05 Fix the unit tests.
37 end
38
39 desc "Run all specs, with coverage testing"
40 Spec::Rake::SpecTask.new(:rcov) do |t|
41 t.spec_files = FileList['spec/**/*_spec.rb']
42 t.spec_opts = ['--color','--backtrace','--diff']
a548e49b » codahale
2007-02-27 Initial checkin.
43 t.rcov = true
46003605 » codahale
2007-03-08 Updated changelog with full details of what's been changed.
44 t.rcov_dir = 'doc/coverage'
79bcfaef » FooBarWidget
2009-08-05 When running the coverage test, correctly ignore non-bcrypt-ruby sour…
45 t.rcov_opts = ['--exclude', 'rspec,diff-lcs,rcov,_spec,_helper']
a548e49b » codahale
2007-02-27 Initial checkin.
46 end
47
48 desc 'Generate RDoc'
49 rd = Rake::RDocTask.new do |rdoc|
46003605 » codahale
2007-03-08 Updated changelog with full details of what's been changed.
50 rdoc.rdoc_dir = 'doc/rdoc'
a548e49b » codahale
2007-02-27 Initial checkin.
51 rdoc.options << '--title' << 'bcrypt-ruby' << '--line-numbers' << '--inline-source' << '--main' << 'README'
52 rdoc.template = ENV['TEMPLATE'] if ENV['TEMPLATE']
51520c43 » codahale
2007-03-08 Fixed cleaning and clobbering, added benchmark task, removed doc dire…
53 rdoc.rdoc_files.include('README', 'COPYING', 'CHANGELOG', 'lib/**/*.rb')
a548e49b » codahale
2007-02-27 Initial checkin.
54 end
55
56 spec = Gem::Specification.new do |s|
57 s.name = PKG_NAME
58 s.version = PKG_VERSION
b53ba3be » codahale
2007-02-28 Actually write a gem description and summary. "Blah" and "Woot" don't…
59 s.summary = "OpenBSD's bcrypt() password hashing algorithm."
a548e49b » codahale
2007-02-27 Initial checkin.
60 s.description = <<-EOF
b53ba3be » codahale
2007-02-28 Actually write a gem description and summary. "Blah" and "Woot" don't…
61 bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project
62 for hashing passwords. bcrypt-ruby provides a simple, humane wrapper for safely handling
63 passwords.
a548e49b » codahale
2007-02-27 Initial checkin.
64 EOF
65
66 s.files = PKG_FILES.to_a
67 s.require_path = 'lib'
68
69 s.has_rdoc = true
70 s.rdoc_options = rd.options
71 s.extra_rdoc_files = rd.rdoc_files.to_a
72
73 s.extensions = FileList["ext/extconf.rb"].to_a
74
e66116dc »
2008-05-07 Prepare for the 2.0.3 release.
75 s.authors = ["Coda Hale"]
a548e49b » codahale
2007-02-27 Initial checkin.
76 s.email = "coda.hale@gmail.com"
77 s.homepage = "http://bcrypt-ruby.rubyforge.org"
78 s.rubyforge_project = "bcrypt-ruby"
79 end
80
81 Rake::GemPackageTask.new(spec) do |pkg|
82 pkg.need_zip = true
83 pkg.need_tar = true
84 end
85
8f7acf49 » FooBarWidget
2009-08-05 Finish JRuby support.
86 desc "Clean, then compile the extension that's native to the current Ruby compiler."
87 if RUBY_PLATFORM == "java"
88 task :compile => 'compile:jruby'
89 else
90 task :compile => 'compile:mri'
91 end
92
93 namespace :compile do
94 desc "CLean, then compile all extensions"
95 task :all => [:mri, :jruby]
96
97 desc "Clean, then compile the MRI extension"
98 task :mri => :clean do
99 Dir.chdir('ext') do
100 ruby "extconf.rb"
101 sh "make"
102 end
103 end
104
105 desc "Clean, then compile the JRuby extension"
106 task :jruby => :clean do
107 Dir.chdir('ext/jruby/bcrypt_jruby') do
108 sh "javac BCrypt.java"
109 end
f01304ab » FooBarWidget
2009-08-05 Improve 'compile' Rake task.
110 end
51520c43 » codahale
2007-03-08 Fixed cleaning and clobbering, added benchmark task, removed doc dire…
111 end
112
90cd2066 » codahale
2007-06-07 Added descriptions to compile and benchmark so's I can find them agai…
113 desc "Run a set of benchmarks on the compiled extension."
51520c43 » codahale
2007-03-08 Fixed cleaning and clobbering, added benchmark task, removed doc dire…
114 task :benchmark do
115 TESTS = 100
116 TEST_PWD = "this is a test"
8caa1cce » FooBarWidget
2009-08-05 When on Ruby 1.9, unlock the global interpreter lock while calculatin…
117 require File.expand_path(File.join(File.dirname(__FILE__), "lib", "bcrypt"))
51520c43 » codahale
2007-03-08 Fixed cleaning and clobbering, added benchmark task, removed doc dire…
118 Benchmark.bmbm do |results|
119 4.upto(10) do |n|
120 results.report("cost #{n}:") { TESTS.times { BCrypt::Password.create(TEST_PWD, :cost => n) } }
121 end
122 end
123 end
Something went wrong with that request. Please try again.