FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
bcrypt-ruby/Rakefile at v3.1.7 · bcrypt-ruby/bcrypt-ruby · GitHub
bcrypt-ruby
bcrypt-ruby
Repository navigation
Code
Issues
16
(16)
Pull requests
9
(9)
Actions
Projects
Security and quality
1
(1)
Insights
Expand file tree
Breadcrumbs
bcrypt-ruby
/
Rakefile
Copy path
More file actions
More file actions
Latest commit
History
History
History
73 lines (65 loc) · 1.76 KB
Breadcrumbs
bcrypt-ruby
/
Rakefile
Copy path
File metadata and controls
73 lines (65 loc) · 1.76 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
require
'rspec/core/rake_task'
require
'rubygems/package_task'
require
'rake/extensiontask'
require
'rake/javaextensiontask'
require
'rake/clean'
require
'rdoc/task'
require
'benchmark'
CLEAN
.
include
(
"ext/mri/*.o"
,
"ext/mri/*.bundle"
,
"ext/mri/*.so"
,
"ext/jruby/bcrypt_jruby/*.class"
)
CLOBBER
.
include
(
"ext/mri/Makefile"
,
"doc/coverage"
,
"pkg"
)
GEMSPEC
=
Gem
::
Specification
.
load
(
"bcrypt.gemspec"
)
task
:default
=>
[
:compile
,
:spec
]
desc
"Run all specs"
RSpec
::
Core
::
RakeTask
.
new
do
|
t
|
t
.
pattern
=
'spec/**/*_spec.rb'
t
.
ruby_opts
=
'-w'
end
desc
"Run all specs, with coverage testing"
RSpec
::
Core
::
RakeTask
.
new
(
:rcov
)
do
|
t
|
t
.
pattern
=
'spec/**/*_spec.rb'
t
.
rcov
=
true
t
.
rcov_path
=
'doc/coverage'
t
.
rcov_opts
=
[
'--exclude'
,
'rspec,diff-lcs,rcov,_spec,_helper'
]
end
desc
'Generate RDoc'
RDoc
::
Task
.
new
do
|
rdoc
|
rdoc
.
rdoc_dir
=
'doc/rdoc'
rdoc
.
options
+=
GEMSPEC
.
rdoc_options
rdoc
.
template
=
ENV
[
'TEMPLATE'
]
if
ENV
[
'TEMPLATE'
]
rdoc
.
rdoc_files
.
include
(
*
GEMSPEC
.
extra_rdoc_files
)
end
Gem
::
PackageTask
.
new
(
GEMSPEC
)
do
|
pkg
|
pkg
.
need_zip
=
true
pkg
.
need_tar
=
true
end
if
RUBY_PLATFORM
=~
/java/
Rake
::
JavaExtensionTask
.
new
(
'bcrypt_ext'
,
GEMSPEC
)
do
|
ext
|
ext
.
ext_dir
=
'ext/jruby'
end
else
Rake
::
ExtensionTask
.
new
(
"bcrypt_ext"
,
GEMSPEC
)
do
|
ext
|
ext
.
ext_dir
=
'ext/mri'
ext
.
cross_compile
=
true
ext
.
cross_platform
=
[
'x86-mingw32'
,
'x64-mingw32'
]
end
end
desc
"Run a set of benchmarks on the compiled extension."
task
:benchmark
do
TESTS
=
100
TEST_PWD
=
"this is a test"
require
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
)
,
"lib"
,
"bcrypt"
)
)
Benchmark
.
bmbm
do
|
results
|
4
.
upto
(
10
)
do
|
n
|
results
.
report
(
"cost
#{
n
}
:"
)
{
TESTS
.
times
{
BCrypt
::
Password
.
create
(
TEST_PWD
,
:cost
=>
n
)
}
}
end
end
end
Back
|
FazBrowse Home
|
New Git URL