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.11.1 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.11.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.9.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.8.1 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.8.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.7.1 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.7.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.6.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.5.3 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.5.2 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.5.1 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.5.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.4.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.3.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.2.1 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.2.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.1.1 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.1.0 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.0.2 lib/octopolo/semver_tag_scrubber.rb
octopolo-1.0.1 lib/octopolo/semver_tag_scrubber.rb