Module: Albacore::Task
- Includes:
- Failure, Logging, UpdateAttributes, YAMLConfig
- Included in:
- AspNetCompiler, AssemblyInfo, CSC, Docu, Exec, FluentMigratorRunner, IlMerge, MSBuild, MSDeploy, MSTestTestRunner, MSpecTestRunner, NAnt, NChurn, NCoverConsole, NCoverReport, NDepend, NUnitTestRunner, NuGetInstall, NuGetPack, NuGetPublish, NuGetPush, NuGetUpdate, Nuspec, Output, PLink, SQLCmd, SpecFlowReport, Unzip, VssGet, XBuild, XUnitTestRunner, ZipDirectory
- Defined in:
- lib/albacore/albacoretask.rb
Instance Attribute Summary
Attributes included from Logging
#current_log_device, #logger
Class Method Summary
collapse
#<<, #update_attributes
Methods included from YAMLConfig
#configure, #initialize, #load_config_by_task_name
Methods included from Logging
#create_logger, #initialize, #log_device=, #log_level, #log_level=
Methods included from Failure
#fail_with_message, #initialize
Class Method Details
.clean_dirname(file) ⇒ Object
29
30
31
32
|
# File 'lib/albacore/albacoretask.rb', line 29
def self.clean_dirname(file)
last = file.rindex "/"
file[0..last]
end
|
.create_rake_task(mod) ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/albacore/albacoretask.rb', line 34
def self.create_rake_task(mod)
if mod.class == Class
tasknames = Array.new
if mod.const_defined?("TaskName")
tasknames << eval("#{mod}::TaskName")
else
tasknames << mod.name.downcase
end
tasknames.flatten.each do |taskname|
Albacore.create_task taskname, mod
end
end
end
|
.include_config(mod, calledby) ⇒ Object
23
24
25
26
27
|
# File 'lib/albacore/albacoretask.rb', line 23
def self.include_config(mod, calledby)
dir = clean_dirname(calledby)
configfile = File.expand_path(File.join(dir, "config", "#{mod.name.downcase}config.rb"))
require configfile if File.exist?(configfile)
end
|
.included(mod) ⇒ Object
17
18
19
20
21
|
# File 'lib/albacore/albacoretask.rb', line 17
def self.included(mod)
mod.extend AttrMethods
self.create_rake_task mod
self.include_config mod, caller[0]
end
|