Class: Rake::Task
- Inherits:
-
Object
- Object
- Rake::Task
- Defined in:
- lib/core/core.rb,
lib/core/core.rb
Direct Known Subclasses
Buildr::Filter, Buildr::JUnitTask, Buildr::Java::CompileTask, Buildr::Jetty::JettyTask, Buildr::Project, Buildr::ReleaseTask, Buildr::UnzipTask, CheckTask
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
Access the base directory.
Instance Method Summary collapse
-
#initialize_with_base_dir(*args) ⇒ Object
:nodoc:.
- #invoke ⇒ Object
-
#invoke_with_base_dir ⇒ Object
:nodoc:.
Instance Attribute Details
#base_dir ⇒ Object
Access the base directory. The base directory is set when the class is defined from the current directory. The current directory is set to the base directory when the class is executed.
70 71 72 |
# File 'lib/core/core.rb', line 70 def base_dir @base_dir end |
Instance Method Details
#initialize_with_base_dir(*args) ⇒ Object
:nodoc:
79 80 81 82 |
# File 'lib/core/core.rb', line 79 def initialize_with_base_dir(*args) @base_dir = Dir.pwd initialize_without_base_dir *args end |
#invoke ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/core/core.rb', line 43 def invoke if application..trace puts "** Invoke #{name} #{format_trace_flags}" end tasks = (Thread.current[:tasks] || []) if tasks.include?(name) fail "Circular dependency " + (tasks + [name]).join("=>") end @lock.synchronize do return if @already_invoked begin Thread.current[:tasks] = tasks + [name] @already_invoked = true invoke_prerequisites execute if needed? ensure Thread.current[:tasks] = tasks end end end |
#invoke_with_base_dir ⇒ Object
:nodoc:
73 74 75 |
# File 'lib/core/core.rb', line 73 def invoke_with_base_dir() Dir.chdir(@base_dir || Dir.pwd) { invoke_without_base_dir } end |