Sha256: c6ab42b12bca801563f95f1ff2c5f6f2864065b3d57c82eff6e9d5751c6addad

Contents?: true

Size: 1.24 KB

Versions: 11

Compression:

Stored size: 1.24 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(".") 

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://twemproxy.googlecode.com/files/#{tarball}"
    sh "tar -zxvf #{tarball}"
    sh "mv nutcracker-#{sversion} ext/nutcracker"
    File.open("ext/nutcracker/extconf.rb",'w') do |file|
      file.puts %q{
        raise "no support for #{RUBY_PLATFORM}" if RUBY_PLATFORM =~ /darwin|mswin|mingw/
        system "./configure --prefix=#{File.expand_path('..',__FILE__)}"
        system 'make'
      }
    end
    sh "rm #{tarball}"
  end
end

task :build => :download do
  sh "rake gem"
end

task :gem => [:clobber_package]

Gem::PackageTask.new Nutcracker::GemSpec do |p|
  p.gem_spec = Nutcracker::GemSpec
end

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

## Tests stuff
task :default => :test

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
nutcracker-0.2.4.12 Rakefile
nutcracker-0.2.4.11 Rakefile
nutcracker-0.2.4.10 Rakefile
nutcracker-0.2.4.10mac Rakefile
nutcracker-0.2.4.9 Rakefile
nutcracker-0.2.4.mac9 Rakefile
nutcracker-0.2.4.8 Rakefile
nutcracker-0.2.4.7 Rakefile
nutcracker-0.2.4.6 Rakefile
nutcracker-0.2.4.5 Rakefile
nutcracker-0.2.4.4 Rakefile