Class: Rake::BaseExtensionTask

Inherits:
TaskLib
  • Object
show all
Defined in:
lib/rake/baseextensiontask.rb

Direct Known Subclasses

ExtensionTask, JavaExtensionTask

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, gem_spec = nil) {|_self| ... } ⇒ BaseExtensionTask

Returns a new instance of BaseExtensionTask.

Yields:

  • (_self)

Yield Parameters:


31
32
33
34
35
# 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

Instance Attribute Details

#config_optionsObject

Returns the value of attribute config_options


22
23
24
# File 'lib/rake/baseextensiontask.rb', line 22

def config_options
  @config_options
end

#ext_dirObject

Returns the value of attribute ext_dir


20
21
22
# File 'lib/rake/baseextensiontask.rb', line 20

def ext_dir
  @ext_dir
end

#extra_optionsObject

Returns the value of attribute extra_options


24
25
26
# File 'lib/rake/baseextensiontask.rb', line 24

def extra_options
  @extra_options
end

#gem_specObject

Returns the value of attribute gem_spec


18
19
20
# File 'lib/rake/baseextensiontask.rb', line 18

def gem_spec
  @gem_spec
end

#lib_dirObject

Returns the value of attribute lib_dir


21
22
23
# File 'lib/rake/baseextensiontask.rb', line 21

def lib_dir
  @lib_dir
end

#nameObject

Returns the value of attribute name


17
18
19
# File 'lib/rake/baseextensiontask.rb', line 17

def name
  @name
end

#platformObject


27
28
29
# File 'lib/rake/baseextensiontask.rb', line 27

def platform
  @platform ||= RUBY_PLATFORM
end

#source_patternObject

Returns the value of attribute source_pattern


23
24
25
# File 'lib/rake/baseextensiontask.rb', line 23

def source_pattern
  @source_pattern
end

#tmp_dirObject

Returns the value of attribute tmp_dir


19
20
21
# File 'lib/rake/baseextensiontask.rb', line 19

def tmp_dir
  @tmp_dir
end

Instance Method Details

#defineObject


47
48
49
50
51
52
# 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) ⇒ Object


37
38
39
40
41
42
43
44
45
# 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