Class: Diggit::Analysis Abstract

Inherits:
Runnable show all
Defined in:
lib/dgit/plugins.rb

Overview

This class is abstract.

Subclass and override run and clean to implement a custom analysis class.

Base class for analyses. Diggit analyses are applied on each source that has been succesfully cloned. They can access the Diggit addons through the addons attribute.

Examples:

A sample analysis using an addon

class AnalysisWithAddon < Diggit::Analysis
	require_addons "db"

	def run
		db.do_something
		puts @options
		puts @source
		puts "Runned!"
	end

	def clean
		puts "Cleaned!"
	end
end

See Also:

Instance Attribute Summary collapse

Attributes inherited from Runnable

#addons

Attributes inherited from Plugin

#options

Instance Method Summary collapse

Methods inherited from Runnable

#clean, require_addons, required_addons, #run

Methods inherited from Plugin

#name, name

Constructor Details

#initialize(options) ⇒ Analysis

Returns a new instance of Analysis.



168
169
170
171
# File 'lib/dgit/plugins.rb', line 168

def initialize(options)
	super(options)
	@source = nil
end

Instance Attribute Details

#sourceSource

Returns the source to be analyzed.

Returns:

  • (Source)

    the source to be analyzed.



165
166
167
168
169
170
171
172
# File 'lib/dgit/plugins.rb', line 165

class Analysis < Runnable
	attr_accessor :source

	def initialize(options)
		super(options)
		@source = nil
	end
end