Module: Rake

Extended by:
Rake, FileUtilsExt
Includes:
Test::Unit::Assertions
Included in:
Rake
Defined in:
lib/rake/gempackagetask.rb,
lib/rake/task.rb,
lib/rake/win32.rb,
lib/rake/tasklib.rb,
lib/rake/runtest.rb,
lib/rake/version.rb,
lib/rake/rdoctask.rb,
lib/rake/rdoctask.rb,
lib/rake/testtask.rb,
lib/rake/file_list.rb,
lib/rake/file_list.rb,
lib/rake/backtrace.rb,
lib/rake/cloneable.rb,
lib/rake/file_task.rb,
lib/rake/early_time.rb,
lib/rake/multi_task.rb,
lib/rake/name_space.rb,
lib/rake/application.rb,
lib/rake/rake_module.rb,
lib/rake/packagetask.rb,
lib/rake/task_manager.rb,
lib/rake/pseudo_status.rb,
lib/rake/default_loader.rb,
lib/rake/file_utils_ext.rb,
lib/rake/dsl_definition.rb,
lib/rake/task_arguments.rb,
lib/rake/loaders/makefile.rb,
lib/rake/contrib/ftptools.rb,
lib/rake/invocation_chain.rb,
lib/rake/file_creation_task.rb,
lib/rake/task_argument_error.rb,
lib/rake/contrib/sshpublisher.rb,
lib/rake/invocation_exception_mixin.rb,
lib/rake/contrib/compositepublisher.rb,
lib/rake/contrib/rubyforgepublisher.rb,
lib/rake/rule_recursion_overflow_error.rb

Overview

:nodoc:

Defined Under Namespace

Modules: AltSystem, Backtrace, Cloneable, DSL, DeprecatedObjectDSL, FileUtilsExt, InvocationExceptionMixin, TaskManager, Version, Win32 Classes: Application, CompositePublisher, DefaultLoader, EarlyTime, FileCreationTask, FileList, FileTask, FtpFile, FtpUploader, InvocationChain, MakefileLoader, MultiTask, NameSpace, PackageTask, PseudoStatus, RubyForgePublisher, RuleRecursionOverflowError, SshDirPublisher, SshFilePublisher, SshFreshDirPublisher, Task, TaskArgumentError, TaskArguments, TaskLib, TestTask

Constant Summary

VERSION =
'0.9.3.beta.1'
RDocTask =
RDoc::Task
EARLY =
EarlyTime.instance
GemPackageTask =
Gem::PackageTask
DeprecatedCommands =
Object.new.extend(DSL)
EMPTY_TASK_ARGS =
TaskArguments.new([], [])

Constants included from FileUtilsExt

FileUtilsExt::DEFAULT

Constants included from FileUtils

FileUtils::LN_SUPPORTED, FileUtils::RUBY

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from FileUtilsExt

nowrite, rake_check_options, rake_merge_option, rake_output_message, verbose, when_writing

Methods included from FileUtils

#ruby, #safe_ln, #sh, #split_all

Class Method Details

+ (Object) application

Current Rake Application



9
10
11
# File 'lib/rake/rake_module.rb', line 9

def application
  @application ||= Rake::Application.new
end

+ (Object) application=(app)

Set the current Rake application object.



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

def application=(app)
  @application = app
end

+ (Object) each_dir_parent(dir)

Yield each file or directory component.



394
395
396
397
398
399
400
401
# File 'lib/rake/file_list.rb', line 394

def each_dir_parent(dir)    # :nodoc:
  old_length = nil
  while dir != '.' && dir.length != old_length
    yield(dir)
    old_length = dir.length
    dir = File.dirname(dir)
  end
end

+ (Object) load_rakefile(path)

Load a rakefile.



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

def load_rakefile(path)
  load(path)
end

+ (Object) original_dir

Return the original directory where the Rake application was started.



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

def original_dir
  application.original_dir
end

Instance Method Details

- (Object) run_tests(pattern = 'test/test*.rb', log_enabled = false)



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rake/runtest.rb', line 7

def run_tests(pattern='test/test*.rb', log_enabled=false)
  Dir["#{pattern}"].each { |fn|
    $stderr.puts fn if log_enabled
    begin
      require fn
    rescue Exception => ex
      $stderr.puts "Error in #{fn}: #{ex.message}"
      $stderr.puts ex.backtrace
      assert false
    end
  }
end