@@ -7,18 +7,6 @@ require 'rake/clean'
77require 'rake/rdoctask'
88require 'benchmark'
99
10- PKG_NAME = "bcrypt-ruby"
11- PKG_VERSION = "2.1.2"
12- PKG_FILE_NAME = "#{ PKG_NAME } -#{ PKG_VERSION } "
13- PKG_FILES = FileList [
14- '[A-Z]*' ,
15- 'lib/**/*.rb' ,
16- 'spec/**/*.rb' ,
17- 'ext/mri/*.c' ,
18- 'ext/mri/*.h' ,
19- 'ext/mri/*.rb' ,
20- 'ext/jruby/bcrypt_jruby/BCrypt.java'
21- ]
2210CLEAN . include (
2311 "ext/mri/*.o" ,
2412 "ext/mri/*.bundle" ,
@@ -30,6 +18,7 @@ CLOBBER.include(
3018 "doc/coverage" ,
3119 "pkg"
3220)
21+ GEMSPEC = eval ( File . read ( File . expand_path ( "../bcrypt-ruby.gemspec" , __FILE__ ) ) )
3322
3423task :default => [ :compile , :spec ]
3524
4938desc 'Generate RDoc'
5039rd = Rake ::RDocTask . new do |rdoc |
5140 rdoc . rdoc_dir = 'doc/rdoc'
52- rdoc . options << '--title' << 'bcrypt-ruby' << '--line-numbers' << '--inline-source' << '--main' << 'README'
41+ rdoc . options += GEMSPEC . rdoc_options
5342 rdoc . template = ENV [ 'TEMPLATE' ] if ENV [ 'TEMPLATE' ]
54- rdoc . rdoc_files . include ( 'README' , 'COPYING' , 'CHANGELOG' , 'lib/**/*.rb' )
43+ rdoc . rdoc_files . include ( * GEMSPEC . extra_rdoc_files )
5544end
5645
57- spec = Gem ::Specification . new do |s |
58- s . name = PKG_NAME
59- s . version = PKG_VERSION
60- s . summary = "OpenBSD's bcrypt() password hashing algorithm."
61- s . description = <<-EOF
62- bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project
63- for hashing passwords. bcrypt-ruby provides a simple, humane wrapper for safely handling
64- passwords.
65- EOF
66-
67- s . files = PKG_FILES . to_a
68- s . require_path = 'lib'
69- s . add_development_dependency 'rake-compiler'
70-
71- s . has_rdoc = true
72- s . rdoc_options = rd . options
73- s . extra_rdoc_files = rd . rdoc_files . to_a
74-
75- s . extensions = FileList [ "ext/mri/extconf.rb" ] . to_a
76-
77- s . authors = [ "Coda Hale" ]
78- s . email = "coda.hale@gmail.com"
79- s . homepage = "http://bcrypt-ruby.rubyforge.org"
80- s . rubyforge_project = "bcrypt-ruby"
81- end
82-
83- Rake ::GemPackageTask . new ( spec ) do |pkg |
46+ Rake ::GemPackageTask . new ( GEMSPEC ) do |pkg |
8447 pkg . need_zip = true
8548 pkg . need_tar = true
8649end
8750
8851if RUBY_PLATFORM =~ /java/
89- Rake ::JavaExtensionTask . new ( 'bcrypt_ext' , spec ) do |ext |
52+ Rake ::JavaExtensionTask . new ( 'bcrypt_ext' , GEMSPEC ) do |ext |
9053 ext . ext_dir = 'ext/jruby'
9154 end
9255else
93- Rake ::ExtensionTask . new ( "bcrypt_ext" , spec ) do |ext |
56+ Rake ::ExtensionTask . new ( "bcrypt_ext" , GEMSPEC ) do |ext |
9457 ext . ext_dir = 'ext/mri'
9558 ext . cross_compile = true
9659 ext . cross_platform = [ 'x86-mingw32' , 'x86-mswin32-60' ]
0 commit comments