Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Split out gemspec so git repo can be used in a Gemfile

  • Loading branch information...
commit 85cd242425bb89f848cce3fdc24d7f8b1cc6764f 1 parent 6c505b3
@tmm1 tmm1 authored
Showing with 35 additions and 44 deletions.
  1. +1 −1  Gemfile
  2. +6 −43 Rakefile
  3. +28 −0 bcrypt-ruby.gemspec
View
2  Gemfile
@@ -1 +1 @@
-gem 'rake-compiler', '>= 0.7.5'
+gemspec
View
49 Rakefile
@@ -7,18 +7,6 @@ require 'rake/clean'
require 'rake/rdoctask'
require 'benchmark'
-PKG_NAME = "bcrypt-ruby"
-PKG_VERSION = "2.1.2"
-PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
-PKG_FILES = FileList[
- '[A-Z]*',
- 'lib/**/*.rb',
- 'spec/**/*.rb',
- 'ext/mri/*.c',
- 'ext/mri/*.h',
- 'ext/mri/*.rb',
- 'ext/jruby/bcrypt_jruby/BCrypt.java'
-]
CLEAN.include(
"ext/mri/*.o",
"ext/mri/*.bundle",
@@ -30,6 +18,7 @@ CLOBBER.include(
"doc/coverage",
"pkg"
)
+GEMSPEC = eval(File.read(File.expand_path("../bcrypt-ruby.gemspec", __FILE__)))
task :default => [:compile, :spec]
@@ -49,48 +38,22 @@ end
desc 'Generate RDoc'
rd = Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'doc/rdoc'
- rdoc.options << '--title' << 'bcrypt-ruby' << '--line-numbers' << '--inline-source' << '--main' << 'README'
+ rdoc.options += GEMSPEC.rdoc_options
rdoc.template = ENV['TEMPLATE'] if ENV['TEMPLATE']
- rdoc.rdoc_files.include('README', 'COPYING', 'CHANGELOG', 'lib/**/*.rb')
+ rdoc.rdoc_files.include(*GEMSPEC.extra_rdoc_files)
end
-spec = Gem::Specification.new do |s|
- s.name = PKG_NAME
- s.version = PKG_VERSION
- s.summary = "OpenBSD's bcrypt() password hashing algorithm."
- s.description = <<-EOF
- bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project
- for hashing passwords. bcrypt-ruby provides a simple, humane wrapper for safely handling
- passwords.
- EOF
-
- s.files = PKG_FILES.to_a
- s.require_path = 'lib'
- s.add_development_dependency 'rake-compiler'
-
- s.has_rdoc = true
- s.rdoc_options = rd.options
- s.extra_rdoc_files = rd.rdoc_files.to_a
-
- s.extensions = FileList["ext/mri/extconf.rb"].to_a
-
- s.authors = ["Coda Hale"]
- s.email = "coda.hale@gmail.com"
- s.homepage = "http://bcrypt-ruby.rubyforge.org"
- s.rubyforge_project = "bcrypt-ruby"
-end
-
-Rake::GemPackageTask.new(spec) do |pkg|
+Rake::GemPackageTask.new(GEMSPEC) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
if RUBY_PLATFORM =~ /java/
- Rake::JavaExtensionTask.new('bcrypt_ext', spec) do |ext|
+ Rake::JavaExtensionTask.new('bcrypt_ext', GEMSPEC) do |ext|
ext.ext_dir = 'ext/jruby'
end
else
- Rake::ExtensionTask.new("bcrypt_ext", spec) do |ext|
+ Rake::ExtensionTask.new("bcrypt_ext", GEMSPEC) do |ext|
ext.ext_dir = 'ext/mri'
ext.cross_compile = true
ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60']
View
28 bcrypt-ruby.gemspec
@@ -0,0 +1,28 @@
+Gem::Specification.new do |s|
+ s.name = 'bcrypt-ruby'
+ s.version = '2.1.3'
+
+ s.summary = "OpenBSD's bcrypt() password hashing algorithm."
+ s.description = <<-EOF
+ bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project
+ for hashing passwords. bcrypt-ruby provides a simple, humane wrapper for safely handling
+ passwords.
+ EOF
+
+ s.files = `git ls-files`.split("\n")
+ s.require_path = 'lib'
+
+ s.add_development_dependency 'rake-compiler'
+ s.add_development_dependency 'rspec'
+
+ s.has_rdoc = true
+ s.rdoc_options += ['--title', 'bcrypt-ruby', '--line-numbers', '--inline-source', '--main', 'README']
+ s.extra_rdoc_files += ['README', 'COPYING', 'CHANGELOG', *Dir['lib/**/*.rb']]
+
+ s.extensions = 'ext/mri/extconf.rb'
+
+ s.authors = ["Coda Hale"]
+ s.email = "coda.hale@gmail.com"
+ s.homepage = "http://bcrypt-ruby.rubyforge.org"
+ s.rubyforge_project = "bcrypt-ruby"
+end
Please sign in to comment.
Something went wrong with that request. Please try again.