Sha256: c614d106a760357f7f4a46bf2a4dfd9353539d7badde88d72f6a879f382f1eaa

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

require 'rubygems'

begin
  require 'bundler/setup'
rescue LoadError => e
  abort e.message
end

require 'rake'
require 'rubygems/tasks'
Gem::Tasks.new

namespace :build do
  desc "Builds the C extensions"
  task :c_exts do
    Dir.chdir('ext/digest') { sh 'rake' }
  end
end

require 'rake/clean'
CLEAN.include('ext/digest/crc*/extconf.h')
CLEAN.include('ext/digest/crc*/Makefile')
CLEAN.include('ext/digest/crc*/*.o')
CLEAN.include('ext/digest/crc*/*.so')

file 'spec/integration/docker/digest-crc.gem' do |t|
  sh "gem build -o #{t.name} digest-crc.gemspec"
end

require 'rspec/core/rake_task'
namespace :spec do
  RSpec::Core::RakeTask.new(:pure) do |t|
    t.exclude_pattern = 'spec/integration/*_spec.rb'
  end
  task :pure => :clean

  if RUBY_ENGINE == 'ruby'
    RSpec::Core::RakeTask.new(:c_exts) do |t|
      t.exclude_pattern = 'spec/integration/*_spec.rb'
    end
    task :c_exts => 'build:c_exts'
  end

  RSpec::Core::RakeTask.new(:integration) do |t|
    t.pattern = 'spec/integration/*_spec.rb'
  end
end

task :spec => 'spec:pure'
task :spec => 'spec:c_exts' if RUBY_ENGINE == 'ruby'

task :test => :spec
task :default => :spec

require 'yard'
YARD::Rake::YardocTask.new
task :doc => :yard

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
digest-crc-0.7.0 Rakefile
digest-crc-0.6.5 Rakefile
digest-crc-0.6.4 Rakefile
digest-crc-0.6.3 Rakefile
digest-crc-0.6.2 Rakefile