Class: CodeFumesHarvester::QuickMetric

Inherits:
Object
  • Object
show all
Defined in:
lib/codefumes_harvester/quick_metric.rb

Class Method Summary collapse

Class Method Details

.save(custom_attributes, repository_path = './') ⇒ Object

Associates a Hash of custom_attributes with the current commit identifier of the repository located at repository_path.

Returns true if the request succeeded.

Returns false if the request failed.



9
10
11
12
13
14
15
16
17
# File 'lib/codefumes_harvester/quick_metric.rb', line 9

def self.save(custom_attributes, repository_path = './')
  repo = SourceControl.new(repository_path)
  commit = {:identifier => repo.local_commit_identifier,
            :custom_attributes => custom_attributes
           }
  content = {:commits => [commit]}
  payload_set = CodeFumes::Payload.prepare(:public_key => repo.public_key, :private_key => repo.private_key, :content => content)
  payload_set.reject {|payload| payload.save}.empty?
end