Class: Object

### Home Classes Methods

### In Files

- lib/mkrf/rakehelper.rb
- lib/mkrf.rb

### Parent

BasicObject

### Methods

- #base_gem_spec
- #mkrf_conf
- #rake
- #setup_clean
- #setup_extension
- #setup_gem
- #setup_rdoc
- #setup_tests
- #sub_project

### Files

- CHANGELOG
- MIT-LICENSE
- README

### Class/Module Index

Quicksearch

- Mkrf
- Mkrf::Availability
- Mkrf::Generator
- Object

No matching classes.

# Object

### Constants

VERSION

### Public Instance Methods

base_gem_spec(pkg_name, pkg_version) click to toggle source

    # File lib/mkrf/rakehelper.rb, line 71
    def base_gem_spec(pkg_name, pkg_version)
      rm_rf "test/coverage"

      pkg_version = pkg_version
      pkg_name    = pkg_name
      pkg_file_name = "#{pkg_name}-#{pkg_version}"
      Gem::Specification.new do |s|
        s.name = pkg_name
        s.version = pkg_version
        s.platform = Gem::Platform::RUBY
        s.has_rdoc = true
        s.extra_rdoc_files = [ "README" ]

        s.files = %(Rakefile) +
          Dir.glob("{bin,doc/rdoc,ext,examples}/**/*") +
          Dir.glob("tools/*.rb") +
          Dir.glob(RUBY_PLATFORM !~ /mswin/ ? "lib/**/*.rb" : "lib/**/*")

        s.require_path = "lib"
        s.bindir = "bin"
      end
    end

mkrf_conf(dir) click to toggle source

    # File lib/mkrf/rakehelper.rb, line 13
    def mkrf_conf(dir)
      Dir.chdir(dir) do ruby "mkrf_conf.rb" end
    end

rake(rakedir) click to toggle source

Copyright (c) 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
    def rake(rakedir)
      Dir.chdir(rakedir) do
        sh '/usr/pkg/bin/rake193'
      end
    end

setup_clean(otherfiles) click to toggle source

    # File lib/mkrf/rakehelper.rb, line 27
    def setup_clean otherfiles
      files = ['build/*', '**/*.o', '**/*.so', '**/*.a', 'lib/*-*', '**/*.log'] + otherfiles
      CLEAN.include(files)
    end

setup_extension(dir, extension) click to toggle source

    # File lib/mkrf/rakehelper.rb, line 42
    def setup_extension(dir, extension)
      ext = "ext/#{dir}"
      ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
      ext_files = FileList[
        "#{ext}/*.c",
        "#{ext}/*.h",
        "#{ext}/mkrf_conf.rb",
        "#{ext}/Rakefile",
        "lib"
      ]

      task "lib" do
        directory "lib"
      end

      desc "Builds just the #{extension} extension"
      task extension.to_sym => ["#{ext}/Rakefile", ext_so ]

      file "#{ext}/Rakefile" => ["#{ext}/mkrf_conf.rb"] do
        mkrf_conf "#{ext}"
      end

      file ext_so => ext_files do
        rake "#{ext}"
        cp ext_so, "lib"
      end
    end

setup_gem(pkg_name, pkg_version) click to toggle source

    # File lib/mkrf/rakehelper.rb, line 94
    def setup_gem(pkg_name, pkg_version)
      spec = base_gem_spec(pkg_name, pkg_version)
      yield spec if block_given?

      Rake::GemPackageTask.new(spec) do |p|
        p.gem_spec = spec
        p.need_tar = true if RUBY_PLATFORM !~ /mswin/
      end
    end

setup_rdoc(files) click to toggle source

    # File lib/mkrf/rakehelper.rb, line 33
    def setup_rdoc files
      Rake::RDocTask.new do |rdoc|
        rdoc.rdoc_dir = 'doc/rdoc'
        rdoc.options << '--line-numbers'
        rdoc.rdoc_files.add(files)
      end
    end

setup_tests() click to toggle source

    # File lib/mkrf/rakehelper.rb, line 18
    def setup_tests
      Rake::TestTask.new do |t|
        t.libs << "test"
        t.test_files = FileList['test/test*.rb']
        t.verbose = true
      end
    end

sub_project(project, *targets) click to toggle source

    # File lib/mkrf/rakehelper.rb, line 105
    def sub_project(project, *targets)
      targets.each do |target|
        Dir.chdir "projects/#{project}" do
          sh %{/usr/pkg/bin/rake193 --trace #{target.to_s} }
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.