lib/trello_helper.rb
# Parse out sortable/prioritizable metadata from card label
Parse out sortable/prioritizable metadata from card label
Parse out sortable / prioritizable metadata from card label
def sortable_card_label(label)
    label_data = @sortable_card_labels[label.name]
    if label_data.nil?
      TrelloHelper::RELEASE_LABEL_REGEX.match(label.name) do |fields|
        label_data = SortableCard.new()
        label_data.state = fields[1] if fields[1]
        label_data.product = fields[2] ? fields[2] : 'ocp'
        if fields[3]
          version = fields[3]
          version.gsub!(/^\D+/, "0.") 
          version = version.scan(/\d+/).join('.') 
          label_data.release = Gem::Version.new(version)
        end
        @sortable_card_labels[label.name] = label_data
      end
    end
    label_data
  end
def sortable_card_label ( label ) label_data = @sortable_card_labels [ label . name ] if label_data . nil? TrelloHelper :: RELEASE_LABEL_REGEX . match ( label . name ) do | fields | label_data = SortableCard . new ( ) label_data . state = fields [ 1 ] if fields [ 1 ] label_data . product = fields [ 2 ] ? fields [ 2 ] : 'ocp' if fields [ 3 ] version = fields [ 3 ] version . gsub! ( / ^ \D + / , "0." ) version = version . scan ( / \d + / ) . join ( '.' ) label_data . release = Gem :: Version . new ( version ) end @sortable_card_labels [ label . name ] = label_data end end label_data end
Parse out sortable/prioritizable metadata from card label
Parse out sortable / prioritizable metadata from card label
# Normalize exotic versions # Normalize exotic versions
label