Class: GitMiner::Engine::CExtensionEngine

Inherits:
AbstractEngine show all
Includes:
GitMinerExt
Defined in:
lib/git_miner/engine/c_extension_engine.rb

Constant Summary collapse

IDENTIFIER =
"CExtension"

Instance Method Summary collapse

Methods included from GitMinerExt

#c_sha1_hexdigest, #c_sha1_mine

Methods inherited from AbstractEngine

#initialize

Constructor Details

This class inherits a constructor from GitMiner::Engine::AbstractEngine

Instance Method Details

#mine(author_offset:, committer_offset:, qty:) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/git_miner/engine/c_extension_engine.rb', line 16

def mine(author_offset:, committer_offset:, qty:)
  c_sha1_mine(author_offset, committer_offset, qty)

  # From C mutations
  if @result_current_sha
    MiningResult.new(
      sha: @result_current_sha,
      author_offset: @result_author_offset,
      committer_offset: @result_committer_offset,
    )
  else
    nil
  end
end

#sha1(str) ⇒ Object



12
13
14
# File 'lib/git_miner/engine/c_extension_engine.rb', line 12

def sha1(str)
  c_sha1_hexdigest(str)
end