Class: Diggit::Analysis Abstract
- Inherits:
-
Object
- Object
- Diggit::Analysis
- Defined in:
- lib/diggit_core.rb
Overview
Subclass and override run and clean to implement a custom analysis class.
Base class for Diggit analyses. Diggit analyses are applied on each source that has been succesfully cloned. They can access the Diggit addons through the addons attribute.
Instance Attribute Summary collapse
-
#addons ⇒ Hash{Symbol => Addon}
readonly
A hash containing the loaded Diggit addons, indexed by names.
-
#globs ⇒ Hash
A hash shared between all analyses of a source.
-
#options ⇒ Hash
readonly
A hash containing the Diggit options.
-
#repo ⇒ Rugged::Repository
readonly
The Rugged Repository object corresponding to the source.
-
#source ⇒ String
readonly
The URL of the source to be analyzed.
Instance Method Summary collapse
-
#clean ⇒ Object
abstract
Clean the data produced by the analysis.
-
#initialize(source, repo, options, addons, globs) ⇒ Analysis
constructor
Create a new analysis.
-
#run ⇒ Object
abstract
Run the analysis.
Constructor Details
#initialize(source, repo, options, addons, globs) ⇒ Analysis
Create a new analysis.
64 65 66 67 68 69 70 |
# File 'lib/diggit_core.rb', line 64 def initialize(source, repo, , addons, globs) @source = source @repo = repo = @addons = addons @globs = globs end |
Instance Attribute Details
#addons ⇒ Hash{Symbol => Addon} (readonly)
Returns a hash containing the loaded Diggit addons, indexed by names.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/diggit_core.rb', line 55 class Analysis # Create a new analysis. # # @param source [String] the URL of the source to be analyzed. # @param repo [Rugged::Repository] the Rugged Repository object corresponding to the source. # @param options [Hash] a hash containing the Diggit options. # @param addons [Hash{Symbol => Addon}] a hash containing the loaded Diggit addons, indexed by names. # @param globs [Hash] a hash shared between all analyses of a source. def initialize(source, repo, , addons, globs) @source = source @repo = repo = @addons = addons @globs = globs end # Run the analysis. # @abstract def run raise NoMethodError.new "Subclass responsability" end # Clean the data produced by the analysis. # @abstract def clean raise NoMethodError.new "Subclass responsability" end end |
#globs ⇒ Hash
Returns a hash shared between all analyses of a source.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/diggit_core.rb', line 55 class Analysis # Create a new analysis. # # @param source [String] the URL of the source to be analyzed. # @param repo [Rugged::Repository] the Rugged Repository object corresponding to the source. # @param options [Hash] a hash containing the Diggit options. # @param addons [Hash{Symbol => Addon}] a hash containing the loaded Diggit addons, indexed by names. # @param globs [Hash] a hash shared between all analyses of a source. def initialize(source, repo, , addons, globs) @source = source @repo = repo = @addons = addons @globs = globs end # Run the analysis. # @abstract def run raise NoMethodError.new "Subclass responsability" end # Clean the data produced by the analysis. # @abstract def clean raise NoMethodError.new "Subclass responsability" end end |
#options ⇒ Hash (readonly)
Returns a hash containing the Diggit options.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/diggit_core.rb', line 55 class Analysis # Create a new analysis. # # @param source [String] the URL of the source to be analyzed. # @param repo [Rugged::Repository] the Rugged Repository object corresponding to the source. # @param options [Hash] a hash containing the Diggit options. # @param addons [Hash{Symbol => Addon}] a hash containing the loaded Diggit addons, indexed by names. # @param globs [Hash] a hash shared between all analyses of a source. def initialize(source, repo, , addons, globs) @source = source @repo = repo = @addons = addons @globs = globs end # Run the analysis. # @abstract def run raise NoMethodError.new "Subclass responsability" end # Clean the data produced by the analysis. # @abstract def clean raise NoMethodError.new "Subclass responsability" end end |
#repo ⇒ Rugged::Repository (readonly)
Returns the Rugged Repository object corresponding to the source.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/diggit_core.rb', line 55 class Analysis # Create a new analysis. # # @param source [String] the URL of the source to be analyzed. # @param repo [Rugged::Repository] the Rugged Repository object corresponding to the source. # @param options [Hash] a hash containing the Diggit options. # @param addons [Hash{Symbol => Addon}] a hash containing the loaded Diggit addons, indexed by names. # @param globs [Hash] a hash shared between all analyses of a source. def initialize(source, repo, , addons, globs) @source = source @repo = repo = @addons = addons @globs = globs end # Run the analysis. # @abstract def run raise NoMethodError.new "Subclass responsability" end # Clean the data produced by the analysis. # @abstract def clean raise NoMethodError.new "Subclass responsability" end end |
#source ⇒ String (readonly)
Returns the URL of the source to be analyzed.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/diggit_core.rb', line 55 class Analysis # Create a new analysis. # # @param source [String] the URL of the source to be analyzed. # @param repo [Rugged::Repository] the Rugged Repository object corresponding to the source. # @param options [Hash] a hash containing the Diggit options. # @param addons [Hash{Symbol => Addon}] a hash containing the loaded Diggit addons, indexed by names. # @param globs [Hash] a hash shared between all analyses of a source. def initialize(source, repo, , addons, globs) @source = source @repo = repo = @addons = addons @globs = globs end # Run the analysis. # @abstract def run raise NoMethodError.new "Subclass responsability" end # Clean the data produced by the analysis. # @abstract def clean raise NoMethodError.new "Subclass responsability" end end |
Instance Method Details
#clean ⇒ Object
Clean the data produced by the analysis.
80 81 82 |
# File 'lib/diggit_core.rb', line 80 def clean raise NoMethodError.new "Subclass responsability" end |
#run ⇒ Object
Run the analysis.
74 75 76 |
# File 'lib/diggit_core.rb', line 74 def run raise NoMethodError.new "Subclass responsability" end |