Module: Rosette::DataStores::PhraseStatus

Defined in:
lib/rosette/data_stores/phrase_status.rb

Overview

Contains several constants indicating the translation status of a set of phrases. Generally attached to commit logs.

Constant Summary collapse

NOT_SEEN =

The commit has not even been seen yet, i.e. this is the first time Rosette has ever encountered it.

'NOT_SEEN'
FETCHED =

The repository that contains this commit has been fetched in preparation for processing it.

'FETCHED'
EXTRACTED =

Indicates the phrases have been extracted from the commit.

'EXTRACTED'
PUSHED =

The extracted phrases have been submitted for translation.

'PUSHED'
FINALIZED =

The commit has been completely processed.

'FINALIZED'
MISSING =

Indicates that the commit no longer exists, i.e. the associated branch was deleted or was force-pushed over.

'MISSING'
NOT_FOUND =

Indicates one or all of the commits have not been processed.

'NOT_FOUND'

Class Method Summary collapse

Class Method Details

.allObject


33
34
35
36
37
# File 'lib/rosette/data_stores/phrase_status.rb', line 33

def self.all
  @all ||= [
    NOT_SEEN, FETCHED, EXTRACTED, PUSHED, FINALIZED, MISSING, NOT_FOUND
  ]
end

.incompleteObject


45
46
47
48
49
# File 'lib/rosette/data_stores/phrase_status.rb', line 45

def self.incomplete
  @incomplete ||= [
    NOT_SEEN, FETCHED, EXTRACTED, PUSHED, NOT_FOUND
  ]
end

.index(status) ⇒ Object


51
52
53
54
55
# File 'lib/rosette/data_stores/phrase_status.rb', line 51

def self.index(status)
  (@status_index ||= {}).fetch(status) do
    statuses.index(status)
  end
end

.statusesObject


39
40
41
42
43
# File 'lib/rosette/data_stores/phrase_status.rb', line 39

def self.statuses
  @statuses ||= [
    NOT_SEEN, FETCHED, EXTRACTED, PUSHED, FINALIZED
  ]
end