Rakefile in faster_path-0.3.8 vs Rakefile in faster_path-0.3.9
- old
+ new
@@ -3,28 +3,25 @@
require 'thermite/tasks'
require 'faster_path/thermite_initialize'
desc 'System Details'
task :sysinfo do
- puts "faster_path #{FasterPath::VERSION}"
- puts
+ puts "** FasterPath - faster_path v#{FasterPath::VERSION} **"
+ puts RUBY_DESCRIPTION
puts `rustc -Vv`
+ puts `ldd --version`.scan(/(.*)\n/).first if RbConfig::CONFIG["host_os"].to_s[/linux/]
puts `cargo -Vv`
- IO.read('Cargo.toml').split('[dependencies]').last.split("\n").
- select {|line| line =~ /=/ }.
- each {|line| puts "%s\t%s" % line.match(/(\S+)[ ="']{1,4}([\d.]+)["']?/).captures }
- puts
- puts RUBY_DESCRIPTION
- puts "bundler\t#{Bundler::VERSION}"
- puts "rake\t#{Rake::VERSION}"
- require 'ffi/version';
- puts "ffi\t#{FFI::VERSION}"
- begin
- puts "%s\t%s" % IO.read('Gemfile.lock').match(/(mspec) \(([\d\.]+)\)/).captures
- rescue Errno::ENOENT => _
- puts "\nNo Gemfile.lock"
- end
+ deps = Regexp.new(/name = "([\w\-]+)"\nversion = "(\d+\.\d+\.\d+)"/)
+ puts "** Rust dependencies **"
+ IO.read("Cargo.lock").
+ scan(deps).
+ delete_if {|i| i[0] == "faster_path" }.
+ each {|name, version| puts "#{name.ljust(20)}#{version}"}
+ puts "** Ruby dependencies **"
+ deps = IO.read("Gemfile.lock")
+ puts deps[(deps =~ /DEPENDENCIES/)..-1].sub("\n\n", "\n")
+ puts "RAKE\n #{Rake::VERSION}"
end
thermite = Thermite::Tasks.new
desc "Generate Contriburs.md Manifest"
@@ -32,40 +29,10 @@
puts "Generating Contriburs.md Manifest"
exec "printf '# Contributors\n
' > Contributors.md;git shortlog -s -n -e | sed 's/^......./- /' >> Contributors.md"
end
-desc "Add libruby to deps"
-task :libruby_release do
- filename = RbConfig::CONFIG["LIBRUBY_ALIASES"].split(" ").first
- libfile = File.join(RbConfig::CONFIG["libdir"], filename)
- deps = "target/release/deps"
-
- printf "Copying libruby.so ... "
- unless File.exist? "#{deps}/#{filename}"
- FileUtils.mkdir_p deps
- FileUtils.cp libfile, deps
- end
- exit 1 unless File.exist? "#{deps}/#{filename}"
- puts "libruby.so copied."
-end
-
-desc "Add libruby to debug deps"
-task :libruby_debug do
- filename = RbConfig::CONFIG["LIBRUBY_ALIASES"].split(" ").first
- libfile = File.join(RbConfig::CONFIG["libdir"], filename)
- deps = "target/debug/deps"
-
- printf "Copying libruby.so ... "
- unless File.exist? "#{deps}/#{filename}"
- FileUtils.mkdir_p deps
- FileUtils.cp libfile, deps
- end
- exit 1 unless File.exist? "#{deps}/#{filename}"
- puts "libruby.so copied."
-end
-
desc 'Build + clean up Rust extension'
task build_lib: 'thermite:build' do
thermite.run_cargo 'clean'
end
@@ -76,11 +43,11 @@
sh 'rubocop'
puts
end
desc "Run Rust Tests"
-task cargo: :libruby_debug do
+task :cargo do
sh "cargo test -- --nocapture"
end
Rake::TestTask.new(minitest: :build_lib) do |t|
t.libs = %w[lib test]
@@ -115,9 +82,12 @@
t.libs = %w[lib test]
t.pattern = 'test/**/*_benchmark.rb'
end
Rake::TestTask.new(pbench: :build_lib) do |t|
+ if ARGV.last == '--long-run'
+ ENV['LONG_RUN'] = '10'
+ end
t.libs = %w[lib test test/pbench]
t.pattern = 'test/pbench/pbench_suite.rb'
end
task default: :test