Class: Rake::BaseExtensionTask
- Inherits:
-
TaskLib
- Object
- TaskLib
- Rake::BaseExtensionTask
- Defined in:
- lib/rake/baseextensiontask.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config_options ⇒ Object
Returns the value of attribute config_options.
-
#ext_dir ⇒ Object
Returns the value of attribute ext_dir.
-
#extra_options ⇒ Object
Returns the value of attribute extra_options.
-
#extra_sources ⇒ Object
Returns the value of attribute extra_sources.
-
#gem_spec ⇒ Object
Returns the value of attribute gem_spec.
-
#lib_dir ⇒ Object
Returns the value of attribute lib_dir.
-
#name ⇒ Object
Returns the value of attribute name.
- #platform ⇒ Object
-
#source_pattern ⇒ Object
Returns the value of attribute source_pattern.
-
#tmp_dir ⇒ Object
Returns the value of attribute tmp_dir.
Instance Method Summary collapse
- #define ⇒ Object
- #init(name = nil, gem_spec = nil) ⇒ Object
-
#initialize(name = nil, gem_spec = nil) {|_self| ... } ⇒ BaseExtensionTask
constructor
A new instance of BaseExtensionTask.
Constructor Details
#initialize(name = nil, gem_spec = nil) {|_self| ... } ⇒ BaseExtensionTask
Returns a new instance of BaseExtensionTask.
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_options ⇒ Object
Returns the value of attribute config_options.
18 19 20 |
# File 'lib/rake/baseextensiontask.rb', line 18 def @config_options end |
#ext_dir ⇒ Object
Returns the value of attribute ext_dir.
16 17 18 |
# File 'lib/rake/baseextensiontask.rb', line 16 def ext_dir @ext_dir end |
#extra_options ⇒ Object
Returns the value of attribute extra_options.
20 21 22 |
# File 'lib/rake/baseextensiontask.rb', line 20 def @extra_options end |
#extra_sources ⇒ Object
Returns the value of attribute extra_sources.
21 22 23 |
# File 'lib/rake/baseextensiontask.rb', line 21 def extra_sources @extra_sources end |
#gem_spec ⇒ Object
Returns the value of attribute gem_spec.
14 15 16 |
# File 'lib/rake/baseextensiontask.rb', line 14 def gem_spec @gem_spec end |
#lib_dir ⇒ Object
Returns the value of attribute lib_dir.
17 18 19 |
# File 'lib/rake/baseextensiontask.rb', line 17 def lib_dir @lib_dir end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/rake/baseextensiontask.rb', line 13 def name @name end |
#platform ⇒ Object
24 25 26 |
# File 'lib/rake/baseextensiontask.rb', line 24 def platform @platform ||= RUBY_PLATFORM end |
#source_pattern ⇒ Object
Returns the value of attribute source_pattern.
19 20 21 |
# File 'lib/rake/baseextensiontask.rb', line 19 def source_pattern @source_pattern end |
#tmp_dir ⇒ Object
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
#define ⇒ Object
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 |