Sha256: fd4f6bb0484979a1a877a25c1fe621633e7d5f0688bdf22650346cee07f52309

Contents?: true

Size: 789 Bytes

Versions: 1

Compression:

Stored size: 789 Bytes

Contents

#
# Description should go here
#
class CaretakerCore
    #
    # We want to create everything as a class/static method
    #
    class << self
        #
        # Make everything else private so it cannot be accessed directly
        #

        private

        def split_log_entries(line, tag)
            hash, hash_full, refs, commit_message, date = line.split('|')

            tag = extract_tag(refs, tag)

            [date, hash, hash_full, commit_message, tag]
        end

        def extract_tag(refs, old_tag)
            tag = old_tag
            if refs.include? 'tag: '
                refs = refs.gsub(/.*tag:/i, '')
                refs = refs.gsub(/,.*/i, '')
                tag = refs.gsub(/\).*/i, '')
            end
            tag.to_s.strip
        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caretaker-core-0.0.1 lib/caretaker-core/utils.rb