Rakefile in faster_path-0.2.6 vs Rakefile in faster_path-0.3.1
- old
+ new
@@ -1,8 +1,8 @@
-require "bundler/gem_tasks"
-require "rake/testtask"
-require 'fileutils'
+require 'bundler/gem_tasks'
+require 'rake/testtask'
+require 'thermite/tasks'
desc 'System Details'
task :sysinfo do
puts "faster_path #{FasterPath::VERSION}"
puts
@@ -22,10 +22,12 @@
rescue Errno::ENOENT => _
puts "\nNo Gemfile.lock"
end
end
+thermite = Thermite::Tasks.new
+
desc "Generate Contriburs.md Manifest"
task :contrib do
puts "Generating Contriburs.md Manifest"
exec "printf '# Contributors\n
' > Contributors.md;git shortlog -s -n -e | sed 's/^......./- /' >> Contributors.md"
@@ -59,51 +61,30 @@
end
exit 1 unless File.exist? "#{deps}/#{filename}"
puts "libruby.so copied."
end
-desc "Build Rust extension"
-task build_src: :libruby_release do
- puts "Building extension..."
- sh "cargo build --release"
+desc 'Build + clean up Rust extension'
+task build_lib: 'thermite:build' do
+ thermite.run_cargo 'clean'
end
-desc "Clean up Rust build"
-task :clean_src do
- puts "Cleaning up build..."
- # Remove all but library file
- FileUtils.
- rm_rf(
- Dir.
- glob('target/release/*').
- keep_if do |f|
- !f[/\.(?:so|dll|dylib|deps)\z/]
- end
- )
-end
-
-desc "Build + clean up Rust extension"
-task build_lib: [:build_src, :clean_src] do
- puts "Completed build!"
-end
-
-desc "Code Quality Check"
+desc 'Code Quality Check'
task :lint do
puts
- puts "Quality check starting..."
- sh "rubocop"
+ puts 'Quality check starting...'
+ sh 'rubocop'
puts
end
desc "Run Rust Tests"
task cargo: :libruby_debug do
sh "cargo test -- --nocapture"
end
Rake::TestTask.new(minitest: :build_lib) do |t|
- t.libs << "test"
- t.libs << "lib"
- t.test_files = FileList['test/**/*_test.rb']
+ t.libs = %w[lib test]
+ t.pattern = 'test/**/*_test.rb'
end
task :init_mspec do |_t|
if Dir.open('spec/mspec').entries.-([".", ".."]).empty?
`git submodule init`