Sha256: 1d600430469bf27e4eb5f94f4c11b60c36400d711f41ee6d442459a7a61ec387

Contents?: true

Size: 1.46 KB

Versions: 5

Compression:

Stored size: 1.46 KB

Contents

$:.unshift File.expand_path '../lib', __FILE__
require 'nutcracker'
require 'rake'
require 'rubygems/package_task'
require "rake/testtask"

Nutcracker::GemSpec = eval File.read 'nutcracker.gemspec'

sversion = Nutcracker.version.split(".")[0..2].join(".") 

desc "Download Nutcracker c app"
task :download do
  "nutcracker-#{sversion}.tar.gz".tap do |tarball|
    sh "mkdir ext" unless File.directory? "ext"
    sh "rm -rf ext/nutcracker"
    sh "wget 'https://drive.google.com/uc?id=0B6pVMMV5F5dfb1YwcThnaVZXbjg&export=download' -O #{tarball}"
    sh "tar -zxvf #{tarball}"
    sh "mv nutcracker-#{sversion} ext/nutcracker"
    Dir.chdir("ext/nutcracker") do 
      sh "autoreconf -fvi"
      c = File.read("configure").gsub("-${am__api_version}","")
      File.open("configure","w") {|f| f.puts c}
    end
    File.open("ext/nutcracker/extconf.rb",'w') do |file|
      file.puts %q{
        system "./configure --prefix=#{File.expand_path('..',__FILE__)}"
        system 'make'
      }
    end
    sh "rm #{tarball}"
  end
end

desc "Download the Nutcracker C app and build new Gem"
task :gem => [:download] do
  sh "gem build nutcracker.gemspec"
end

task :install => [:gem] do
   sh "gem install pkg/nutcracker"
   Rake::Task['clobber_package'].execute
end

## Tests stuff
task :default => :test

task :test do
  sh "./compile_ext.bash" unless File.exists? "ext/nutcracker/src/nutcracker"
end

Rake::TestTask.new(:test) do |t|
  t.libs << "tests"
  t.pattern = "tests/**/*_test.rb"
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nutcracker-0.4.1.23 Rakefile
nutcracker-0.4.1.22 Rakefile
nutcracker-0.4.1.21 Rakefile
nutcracker-0.4.1.20 Rakefile
nutcracker-0.4.1.19 Rakefile