Rakefile in congruence_solver-0.3.2 vs Rakefile in congruence_solver-0.4.0

- old
+ new

@@ -18,12 +18,11 @@ files_to_rm_ary.each {|fname| verbose_sh_exec "#{rm_cmd} #{fname}"} end # runs the csolve binary task :exe do - $LOAD_PATH << "#{Dir.pwd}/lib/" - require_relative "bin/csolve.rb" + system "bin/csolve" end #spec runs all RSpec examples RSpec::Core::RakeTask.new :spec @@ -40,17 +39,11 @@ ext.lib_dir = "lib/congruence_solver" end # runs benchmarks task :bench do - $LOAD_PATH << "#{Dir.pwd}/lib/" - Dir.foreach("bench") do |bm_file| - path = "bench/#{bm_file}" - if File.file? path and path =~ "_bm.rb^" - require_relative path - end - end + system "csolve bench" end # download source files for the extension task :download_ext do congruences_lib_url="https://github.com/laneb/congruences/archive/master.zip" @@ -76,11 +69,15 @@ task :update_ext => [:purge_ext, :download_ext, :compile_ext] # remove files generated or left behind by build task :clean do - files_to_rm = `find ext/congruence_solver/* -not -path "*.[ch]" -not -path *Makefile -not -path *extconf.rb`.split("\n") + ext_compiled_files = `find ext/congruence_solver/* -not -path "*.[ch]" -not -path *Makefile -not -path *extconf.rb`.split("\n") + files_to_rm = ext_compiled_files + %w[ + *.gem + lib/congruence_solver/congruence_solver.* + ] verbose_rm_files files_to_rm end # build Ruby gem task :build => [:compile_ext] do @@ -98,10 +95,10 @@ else verbose_sh_exec "gem install #{dot_gem_files.first}" end end -task :publish => [:clean, :update_ext, :build] do +task :publish do cmd = "gem push *.gem" p cmd system cmd end