Sha256: 7dff2379ccbbbecef9b2cf34d122daa9b5551cf8cd03cc9f898e585866926154

Contents?: true

Size: 357 Bytes

Versions: 33

Compression:

Stored size: 357 Bytes

Contents

module Octopolo
  class SemverTagScrubber

    def self.scrub_prefix(tag)
      scrub_via_regexp(tag, /\A[a-z]*/i)
    end

    def self.scrub_suffix(tag)
      scrub_via_regexp(tag, /[a-z]*\z/i)
    end

    private

    def self.scrub_via_regexp(tag, regexp)
      result = tag.match(regexp)[0]
      tag.gsub!(regexp, '')
      result
    end

  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
octopolo-1.0.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.4.1 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.4.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.3.6 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.3.5 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.3.4 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.3.3 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.3.2 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.3.1 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.3.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.2.1 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.1.4 lib/octopolo/semver_tag_scrubber.rb
octopolo-0.2.0 lib/octopolo/semver_tag_scrubber.rb