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

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

Returns a new instance of BaseExtensionTask

Yields:

  • (_self)

Yield Parameters:



34
35
36
37
38
# File 'lib/rake/baseextensiontask.rb', line 34

def initialize(name = nil, gem_spec = nil)
  init(name, gem_spec)
  yield self if block_given?
  define
end

Instance Attribute Details

- (Object) config_options

Returns the value of attribute config_options



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

def config_options
  @config_options
end

- (Object) ext_dir

Returns the value of attribute ext_dir



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

def ext_dir
  @ext_dir
end

- (Object) gem_spec

Returns the value of attribute gem_spec



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

def gem_spec
  @gem_spec
end

- (Object) lib_dir

Returns the value of attribute lib_dir



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

def lib_dir
  @lib_dir
end

- (Object) name

Returns the value of attribute name



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

def name
  @name
end

- (Object) platform

Returns the value of attribute platform



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

def platform
  @platform ||= RUBY_PLATFORM
end

- (Object) source_pattern

Returns the value of attribute source_pattern



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

def source_pattern
  @source_pattern
end

- (Object) tmp_dir

Returns the value of attribute tmp_dir



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

def tmp_dir
  @tmp_dir
end

Instance Method Details

- (Object) define



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

def define
  fail "Extension name must be provided." if @name.nil?

  define_compile_tasks
end

- (Object) init(name = nil, gem_spec = nil)



40
41
42
43
44
45
46
47
# File 'lib/rake/baseextensiontask.rb', line 40

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 = []
end