Sha256: 0bc80baecae6b515265ed8d01838f369c0ff2af3bccf85596cb47f132cd83e86

Contents?: true

Size: 1.07 KB

Versions: 3

Compression:

Stored size: 1.07 KB

Contents

require "bundler/gem_tasks"
require 'rake/testtask'
require 'rake/clean'

NAME = 'iconv'

# rule to build the extension: this says
# that the extension should be rebuilt
# after any change to the files in ext
file "lib/#{NAME}/#{NAME}.#{RbConfig::CONFIG['DLEXT']}" =>
    Dir.glob("ext/#{NAME}/*{.rb,.c}") do
  Dir.chdir("ext/#{NAME}") do
    # this does essentially the same thing
    # as what RubyGems does
    ruby "extconf.rb", *ARGV.grep(/\A--/)
    sh "make", *ARGV.grep(/\A(?!--)/)
  end
  cp "ext/#{NAME}/#{NAME}.#{RbConfig::CONFIG['DLEXT']}", "lib/#{NAME}"
end

# make the :test task depend on the shared
# object, so it will be built automatically
# before running the tests
task :test => "lib/#{NAME}/#{NAME}.#{RbConfig::CONFIG['DLEXT']}"

# use 'rake clean' and 'rake clobber' to
# easily delete generated files
CLEAN.include("ext/**/*{.o,.log,.#{RbConfig::CONFIG['DLEXT']}}")
CLEAN.include("ext/**/Makefile")
CLOBBER.include("lib/**/*.#{RbConfig::CONFIG['DLEXT']}")

# the same as before
Rake::TestTask.new do |t|
  t.libs << 'test'
end

desc "Run tests"
task :default => :test

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
iconv-1.1.0 Rakefile
iconv-1.0.8 Rakefile
iconv-1.0.7 Rakefile