Class: Rake::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/core/core.rb,
lib/core/core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_dirObject

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

#invokeObject



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.options.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_dirObject

: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