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:



28
29
30
31
32
# File 'lib/rake/baseextensiontask.rb', line 28

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.



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

def config_options
  @config_options
end

#ext_dirObject

Returns the value of attribute ext_dir.



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

def ext_dir
  @ext_dir
end

#extra_optionsObject

Returns the value of attribute extra_options.



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

def extra_options
  @extra_options
end

#extra_sourcesObject

Returns the value of attribute extra_sources.



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

def extra_sources
  @extra_sources
end

#gem_specObject

Returns the value of attribute gem_spec.



14
15
16
# File 'lib/rake/baseextensiontask.rb', line 14

def gem_spec
  @gem_spec
end

#lib_dirObject

Returns the value of attribute lib_dir.



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

def lib_dir
  @lib_dir
end

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/rake/baseextensiontask.rb', line 13

def name
  @name
end

#platformObject



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

def platform
  @platform ||= RUBY_PLATFORM
end

#source_patternObject

Returns the value of attribute source_pattern.



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

def source_pattern
  @source_pattern
end

#tmp_dirObject

Returns the value of attribute tmp_dir.



15
16
17
# File 'lib/rake/baseextensiontask.rb', line 15

def tmp_dir
  @tmp_dir
end

Instance Method Details

#defineObject



48
49
50
51
52
53
# File 'lib/rake/baseextensiontask.rb', line 48

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



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/rake/baseextensiontask.rb', line 34

def init(name = nil, gem_spec = nil)
  @name = name
  @gem_spec = gem_spec
  @tmp_dir = 'tmp'
  @ext_dir = "ext/#{@name}"
  @lib_dir = 'lib'
  if @name and File.dirname(@name.to_s) != "."
    @lib_dir += "/#{File.dirname(@name.to_s)}"
  end
  @config_options = []
  @extra_options = ARGV.select { |i| i =~ /\A--?/ }
  @extra_sources = FileList[]
end