Sha256: d1c48e21307e65f90f363cd83064ddde530645483e200615c175de87a54968c9

Contents?: true

Size: 1.54 KB

Versions: 4

Compression:

Stored size: 1.54 KB

Contents

require 'rspec/core/rake_task'
require 'rubygems/package_task'
require 'rake/extensiontask'

Dir[File.expand_path("../*gemspec", __FILE__)].reverse.each do |gemspec_path|
  gemspec = eval(IO.read(gemspec_path))
  Gem::PackageTask.new(gemspec).define
end

require 'ffi_yajl/version'

desc "Run all specs in spec directory"
RSpec::Core::RakeTask.new(:spec) do |t|
  t.pattern = FileList['spec/**/*_spec.rb']
end

desc "Build it and ship it"
task :ship => [:clean, :gem] do
  sh("git tag #{Mixlib::ShellOut::VERSION}")
  sh("git push --tags")
  Dir[File.expand_path("../pkg/*.gem", __FILE__)].reverse.each do |built_gem|
    sh("gem push #{built_gem}")
  end
end

unix_gemspec = eval(File.read("ffi-yajl.gemspec"))

task :clean do
  sh "rm -rf pkg/* lib/ffi_yajl/ext/*"
end

desc "install the gem locally"
task :install => [:package] do
  if defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby"
    sh %{gem install pkg/#{unix_gemspec.name}-#{unix_gemspec.version}-universal-java.gem}
  else
    sh %{gem install pkg/#{unix_gemspec.name}-#{unix_gemspec.version}.gem}
  end
end

spec = Gem::Specification.load('ffi-yajl.gemspec')

Rake::ExtensionTask.new do |ext|
  ext.name = 'libyajl'
  ext.lib_dir = 'lib'
  ext.ext_dir = 'ext/libyajl2'
  ext.gem_spec = spec
end

Rake::ExtensionTask.new do |ext|
  ext.name = 'encoder'
  ext.lib_dir = 'lib/ffi_yajl/ext'
  ext.ext_dir = 'ext/ffi_yajl/ext/encoder'
  ext.gem_spec = spec
end

Rake::ExtensionTask.new do |ext|
  ext.name = 'parser'
  ext.lib_dir = 'lib/ffi_yajl/ext'
  ext.ext_dir = 'ext/ffi_yajl/ext/parser'
  ext.gem_spec = spec
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ffi-yajl-0.0.2-universal-java Rakefile
ffi-yajl-0.0.2 Rakefile
ffi-yajl-0.0.1-universal-java Rakefile
ffi-yajl-0.0.1 Rakefile