Rakefile in faster_path-0.0.1 vs Rakefile in faster_path-0.0.2

- old
+ new

@@ -1,6 +1,33 @@ require "bundler/gem_tasks" require "rake/testtask" +require 'fileutils' + +desc "Building extension..." +task :build_src do + puts "Building extension..." + system("cargo build --release") +end + +desc "Cleaning up build..." +task :clean_src do + puts "Cleaning up build..." + # Remove all but library file + FileUtils. + rm_rf( + Dir. + glob('target/release/*'). + keep_if {|f| + # TODO: change regex to include other library extensions for other OS builds + !f[/\.so\z/] + } + ) +end + +desc "Compiling Rust extension..." +task :build_lib => [:build_src, :clean_src] do + puts "Completed build!" +end Rake::TestTask.new(:test) do |t| t.libs << "test" t.libs << "lib" t.test_files = FileList['test/**/*_test.rb']