Class: Kolekti::Collector

Inherits:
Object
  • Object
show all
Defined in:
lib/kolekti/collector.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, description, supported_metrics) ⇒ Collector

Returns a new instance of Collector.



18
19
20
21
22
# File 'lib/kolekti/collector.rb', line 18

def initialize(name, description, supported_metrics)
  @name = name
  @description = description
  @supported_metrics = supported_metrics
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/kolekti/collector.rb', line 6

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/kolekti/collector.rb', line 6

def name
  @name
end

#supported_metricsObject (readonly)

Returns the value of attribute supported_metrics.



6
7
8
# File 'lib/kolekti/collector.rb', line 6

def supported_metrics
  @supported_metrics
end

Class Method Details

.available?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


16
# File 'lib/kolekti/collector.rb', line 16

def self.available?; raise NotImplementedError; end

.run_if_available(command) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/kolekti/collector.rb', line 8

def self.run_if_available(command)
  begin
    `#{command}`
  rescue SystemCallError
    nil
  end
end

Instance Method Details

#clean(code_directory, wanted_metric_configurations) ⇒ Object

Raises:

  • (NotImplementedError)


26
# File 'lib/kolekti/collector.rb', line 26

def clean(code_directory, wanted_metric_configurations); raise NotImplementedError; end

#collect_metrics(code_directory, wanted_metric_configurations, persistence_strategy) ⇒ Object

Raises:

  • (NotImplementedError)


24
# File 'lib/kolekti/collector.rb', line 24

def collect_metrics(code_directory, wanted_metric_configurations, persistence_strategy); raise NotImplementedError; end

#default_value_from(metric_configuration) ⇒ Object

Raises:

  • (NotImplementedError)


28
# File 'lib/kolekti/collector.rb', line 28

def default_value_from(metric_configuration); raise NotImplementedError; end