Sha256: 5140b87bfe015fe335c4936ffc0a71b37f823ecd4081f8ad9f5f9470d01abeab
Contents?: true
Size: 1.82 KB
Versions: 10
Compression:
Stored size: 1.82 KB
Contents
def template_rakefile <<-EOF # add rake-compiler lib dir to the LOAD_PATH $LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '../..', 'lib')) require 'rubygems' require 'rake' # load rakefile extensions (tasks) Dir['tasks/*.rake'].each { |f| import f } EOF end def template_rake_gemspec(gem_name) <<-EOF require 'rake/gempackagetask' SPEC = Gem::Specification.new do |s| s.name = "#{gem_name}" s.version = "0.1.0" s.summary = "#{gem_name} test gem for rake-compiler" s.files = FileList["ext/**/*.{rb,c,h}", "Rakefile", "tasks/*.rake", "lib/**/*.rb"] s.extensions = FileList["ext/**/extconf.rb"] s.has_rdoc = true s.homepage = 'http://github.com/luislavena/rake-compiler' s.rubyforge_project = 'TODO' s.authors = ["Luis Lavena"] s.email = ["luislavena@gmail.com"] end gem_package = Rake::GemPackageTask.new(SPEC) do |pkg| pkg.need_zip = false pkg.need_tar = false end EOF end def template_rake_extension(extension_name, gem_spec = nil) <<-EOF require 'rake/extensiontask' Rake::ExtensionTask.new("#{extension_name}"#{', SPEC' if gem_spec}) EOF end def template_rake_extension_with_platform(extension_name, platform) <<-EOF require 'rake/extensiontask' Rake::ExtensionTask.new("#{extension_name}", SPEC) do |ext| ext.platform = "#{platform}" end EOF end def template_rake_extension_cross_compile(extension_name, gem_spec = nil) <<-EOF require 'rake/extensiontask' Rake::ExtensionTask.new("#{extension_name}"#{', SPEC' if gem_spec}) do |ext| ext.cross_compile = true end EOF end def template_extconf(extension_name) <<-EOF require 'mkmf' create_makefile("#{extension_name}") EOF end def template_source_c(extension_name) <<-EOF #include "source.h" void Init_#{extension_name}() { printf("source.c of extension #{extension_name}\\n"); } EOF end def template_source_h <<-EOF #include "ruby.h" EOF end
Version data entries
10 entries across 10 versions & 2 rubygems