# class Rake::BaseExtensionTask

### Attributes

config_options[RW]
ext_dir[RW]
extra_options[RW]
gem_spec[RW]
lib_dir[RW]
name[RW]
platform[W]
source_pattern[RW]
tmp_dir[RW]

### Public Class Methods

new(name = nil, gem_spec = nil) { |self| ... } click to toggle source

    # File lib/rake/baseextensiontask.rb, line 31
    def initialize(name = nil, gem_spec = nil)
      init(name, gem_spec)
      yield self if block_given?
      define
    end

### Public Instance Methods

define() click to toggle source

    # File lib/rake/baseextensiontask.rb, line 47
    def define
      fail "Extension name must be provided." if @name.nil?
      @name = @name.to_s

      define_compile_tasks
    end

init(name = nil, gem_spec = nil) click to toggle source

    # File lib/rake/baseextensiontask.rb, line 37
    def init(name = nil, gem_spec = nil)
      @name = name
      @gem_spec = gem_spec
      @tmp_dir = 'tmp'
      @ext_dir = "ext/#{@name}"
      @lib_dir = 'lib'
      @config_options = []
      @extra_options = ARGV.select { |i| i =~ /\A--?/ }
    end

platform() click to toggle source

    # File lib/rake/baseextensiontask.rb, line 27
    def platform
      @platform ||= RUBY_PLATFORM
    end

### Private Instance Methods

binary(platform = nil) click to toggle source

    # File lib/rake/baseextensiontask.rb, line 60
    def binary(platform = nil)
      ext = case platform
        when /darwin/
          'bundle'
        when /mingw|mswin|linux/
          'so'
        when /java/
          'jar'
        else
          RbConfig::CONFIG['DLEXT']
      end
      "#{@name}.#{ext}"
    end

define_compile_tasks() click to toggle source

    # File lib/rake/baseextensiontask.rb, line 56
    def define_compile_tasks
      raise NotImplementedError
    end

source_files() click to toggle source

    # File lib/rake/baseextensiontask.rb, line 74
    def source_files
      FileList["#{@ext_dir}/#{@source_pattern}"]
    end

warn_once(message) click to toggle source

    # File lib/rake/baseextensiontask.rb, line 78
    def warn_once(message)
      @@already_warned ||= false
      return if @@already_warned
      @@already_warned = true
      warn message
    end

windows?() click to toggle source

    # File lib/rake/baseextensiontask.rb, line 85
    def windows?
      Rake.application.windows?
    end