Rakefile in games_dice-0.3.3 vs Rakefile in games_dice-0.3.5

- old
+ new

@@ -1,10 +1,15 @@ require "bundler/gem_tasks" require "rspec/core/rake_task" require 'rake/extensiontask' require "yard" +def can_compile_extensions + return false if RUBY_DESCRIPTION =~ /jruby/ + return true +end + desc "GamesDice unit tests" RSpec::Core::RakeTask.new(:test) do |t| t.pattern = "spec/*_spec.rb" t.verbose = false end @@ -20,6 +25,16 @@ ext.ext_dir = 'ext/games_dice' ext.lib_dir = 'lib/games_dice' ext.gem_spec = gemspec end -task :default => [:compile, :test] +task :delete_compiled_ext do |t| + `rm lib/games_dice/games_dice.*` +end + +task :pure_test => [:delete_compiled_ext, :test] + +if can_compile_extensions + task :default => [:compile, :test] +else + task :default => [:test] +end