Sha256: 11cc99231b37c15b5c9089cd203de680618523f9d8bd08be87ac57ea6f357289

Contents?: true

Size: 928 Bytes

Versions: 26

Compression:

Stored size: 928 Bytes

Contents

require 'rake/extensiontask'

def gemspec
  @clean_gemspec ||= eval(File.read(File.expand_path('../../yajl-ruby.gemspec', __FILE__)))
end

Rake::ExtensionTask.new('yajl', gemspec) do |ext|
  # automatically add build options to avoid need of manual input
  ext.cross_compile = true
  ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60']

  # inject 1.8/1.9 pure-ruby entry point when cross compiling only
  ext.cross_compiling do |spec|
    spec.files << 'lib/yajl/yajl.rb'
  end

  ext.lib_dir = File.join 'lib', 'yajl'

  # clean compiled extension
  CLEAN.include "#{ext.lib_dir}/*.#{RbConfig::CONFIG['DLEXT']}"
end
Rake::Task[:spec].prerequisites << :compile

file 'lib/yajl/yajl.rb' do |t|
  File.open(t.name, 'wb') do |f|
    f.write <<-eoruby
RUBY_VERSION =~ /(\\d+.\\d+)/
require "yajl/\#{$1}/yajl"
    eoruby
  end
end

if Rake::Task.task_defined?(:cross)
  Rake::Task[:cross].prerequisites << 'lib/yajl/yajl.rb'
end

Version data entries

26 entries across 26 versions & 9 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/tasks/compile.rake
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/tasks/compile.rake
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/tasks/compile.rake
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/yajl-ruby-1.4.3/tasks/compile.rake
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/yajl-ruby-1.4.3/tasks/compile.rake
yajl-ruby-1.4.3 tasks/compile.rake
yajl-ruby-1.4.2 tasks/compile.rake
yajl-ruby-1.4.1 tasks/compile.rake
yajl-ruby-1.4.0 tasks/compile.rake
yajl-ruby-1.2.3 tasks/compile.rake
yajl-ruby-1.3.1 tasks/compile.rake
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/yajl-ruby-1.3.0/tasks/compile.rake
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/yajl-ruby-1.3.0/tasks/compile.rake
yajl-ruby-1.2.2 tasks/compile.rake
yajl-ruby-1.3.0 tasks/compile.rake
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/yajl-ruby-1.2.1/tasks/compile.rake
yajl-ruby-1.2.1 tasks/compile.rake
yajl-ruby-1.2.0 tasks/compile.rake
yajl-ruby-zenjoy-1.1.0 tasks/compile.rake
yajl-ruby-maglev--1.1.0 tasks/compile.rake