Sitelet https://github.com/bcrypt-ruby/bcrypt-ruby/commit/85cd242425bb89f848cce3fdc24d7f8b1cc6764f
Skip to content

Commit 85cd242

Browse files
committed
Split out gemspec so git repo can be used in a Gemfile
1 parent 6c505b3 commit 85cd242

3 files changed

Lines changed: 35 additions & 44 deletions

File tree

‎Gemfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
gem 'rake-compiler', '>= 0.7.5'
1+
gemspec

‎Rakefile‎

Lines changed: 6 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ require 'rake/clean'
77
require 'rake/rdoctask'
88
require '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-
]
2210
CLEAN.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

3423
task :default => [:compile, :spec]
3524

@@ -49,48 +38,22 @@ end
4938
desc 'Generate RDoc'
5039
rd = 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)
5544
end
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
8649
end
8750

8851
if 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
9255
else
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']

‎bcrypt-ruby.gemspec‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Gem::Specification.new do |s|
2+
s.name = 'bcrypt-ruby'
3+
s.version = '2.1.3'
4+
5+
s.summary = "OpenBSD's bcrypt() password hashing algorithm."
6+
s.description = <<-EOF
7+
bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project
8+
for hashing passwords. bcrypt-ruby provides a simple, humane wrapper for safely handling
9+
passwords.
10+
EOF
11+
12+
s.files = `git ls-files`.split("\n")
13+
s.require_path = 'lib'
14+
15+
s.add_development_dependency 'rake-compiler'
16+
s.add_development_dependency 'rspec'
17+
18+
s.has_rdoc = true
19+
s.rdoc_options += ['--title', 'bcrypt-ruby', '--line-numbers', '--inline-source', '--main', 'README']
20+
s.extra_rdoc_files += ['README', 'COPYING', 'CHANGELOG', *Dir['lib/**/*.rb']]
21+
22+
s.extensions = 'ext/mri/extconf.rb'
23+
24+
s.authors = ["Coda Hale"]
25+
s.email = "coda.hale@gmail.com"
26+
s.homepage = "http://bcrypt-ruby.rubyforge.org"
27+
s.rubyforge_project = "bcrypt-ruby"
28+
end

0 commit comments

Comments
 (0)