Class: NDepend

Inherits:
Object
  • Object
show all
Includes:
Albacore::RunCommand, Albacore::Task
Defined in:
lib/albacore/ndepend.rb

Instance Attribute Summary collapse

Attributes included from Albacore::RunCommand

#command, #working_directory

Attributes included from Logging

#current_log_device, #logger

Instance Method Summary collapse

Methods included from Albacore::RunCommand

#get_command, #run_command

Methods included from AttrMethods

#attr_array, #attr_hash

Methods included from Albacore::Task

clean_dirname, create_rake_task, include_config, included

Methods included from UpdateAttributes

#<<, #update_attributes

Methods included from YAMLConfig

#configure, #load_config_by_task_name

Methods included from Logging

#create_logger, #log_device=, #log_level, #log_level=

Methods included from Failure

#fail_with_message

Constructor Details

#initializeNDepend

Returns a new instance of NDepend.



9
10
11
12
# File 'lib/albacore/ndepend.rb', line 9

def initialize()
  super()
  update_attributes Albacore.configuration.ndepend.to_hash
end

Instance Attribute Details

#project_fileObject

Returns the value of attribute project_file.



7
8
9
# File 'lib/albacore/ndepend.rb', line 7

def project_file
  @project_file
end

Instance Method Details

#check_commandObject



27
28
29
30
31
# File 'lib/albacore/ndepend.rb', line 27

def check_command
  return true if @project_file
  fail_with_message 'A ndepend project file is required'
  false
end

#create_parametersObject



21
22
23
24
25
# File 'lib/albacore/ndepend.rb', line 21

def create_parameters
  params = []
  params << File.expand_path(@project_file)
  params
end

#executeObject



14
15
16
17
18
19
# File 'lib/albacore/ndepend.rb', line 14

def execute
  return unless check_command
  result = run_command @command, create_parameters.join(" ")
  failure_message = 'Command Failed. See Build Log For Detail'
  fail_with_message failure_message if !result
end