# File lib/mkrf/rakehelper.rb, line 71 71: def base_gem_spec(pkg_name, pkg_version) 72: rm_rf "test/coverage" 73: 74: pkg_version = pkg_version 75: pkg_name = pkg_name 76: pkg_file_name = "#{pkg_name}-#{pkg_version}" 77: Gem::Specification.new do |s| 78: s.name = pkg_name 79: s.version = pkg_version 80: s.platform = Gem::Platform::RUBY 81: s.has_rdoc = true 82: s.extra_rdoc_files = [ "README" ] 83: 84: s.files = %(Rakefile) + 85: Dir.glob("{bin,doc/rdoc,ext,examples}/**/*") + 86: Dir.glob("tools/*.rb") + 87: Dir.glob(RUBY_PLATFORM !~ /mswin/ ? "lib/**/*.rb" : "lib/**/*") 88: 89: s.require_path = "lib" 90: s.bindir = "bin" 91: end 92: end
# File lib/mkrf/rakehelper.rb, line 13 13: def mkrf_conf(dir) 14: Dir.chdir(dir) do ruby "mkrf_conf.rb" end 15: end
Copyright © 2005 Zed A. Shaw with portions by Kevin Clark You can redistribute it and/or modify it under the same terms as Ruby.
# File lib/mkrf/rakehelper.rb, line 6 6: def rake(rakedir) 7: Dir.chdir(rakedir) do 8: sh 'rake' 9: end 10: end
# File lib/mkrf/rakehelper.rb, line 27 27: def setup_clean otherfiles 28: files = ['build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log'] + otherfiles 29: CLEAN.include(files) 30: end
# File lib/mkrf/rakehelper.rb, line 42 42: def setup_extension(dir, extension) 43: ext = "ext/#{dir}" 44: ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}" 45: ext_files = FileList[ 46: "#{ext}/*.c", 47: "#{ext}/*.h", 48: "#{ext}/mkrf_conf.rb", 49: "#{ext}/Rakefile", 50: "lib" 51: ] 52: 53: task "lib" do 54: directory "lib" 55: end 56: 57: desc "Builds just the #{extension} extension" 58: task extension.to_sym => ["#{ext}/Rakefile", ext_so ] 59: 60: file "#{ext}/Rakefile" => ["#{ext}/mkrf_conf.rb"] do 61: mkrf_conf "#{ext}" 62: end 63: 64: file ext_so => ext_files do 65: rake "#{ext}" 66: cp ext_so, "lib" 67: end 68: end
# File lib/mkrf/rakehelper.rb, line 94 94: def setup_gem(pkg_name, pkg_version) 95: spec = base_gem_spec(pkg_name, pkg_version) 96: yield spec if block_given? 97: 98: 99: Rake::GemPackageTask.new(spec) do |p| 100: p.gem_spec = spec 101: p.need_tar = true if RUBY_PLATFORM !~ /mswin/ 102: end 103: end
# File lib/mkrf/rakehelper.rb, line 33 33: def setup_rdoc files 34: Rake::RDocTask.new do |rdoc| 35: rdoc.rdoc_dir = 'doc/rdoc' 36: rdoc.options << '--line-numbers' 37: rdoc.rdoc_files.add(files) 38: end 39: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.