Sha256: e44d1dc110ca5dd2d32de9c588e72584fb28b3c10611db235b1c8c3a12f5e8e6

Contents?: true

Size: 531 Bytes

Versions: 11

Compression:

Stored size: 531 Bytes

Contents

require 'structured_changelog/release_filters/base'
require 'structured_changelog/version_pattern'

class StructuredChangelog
  module ReleaseFilters
    class MatchesVersionsLessThanOrEqualTo < Base
      def self.pattern
        /^\<\ #{VersionPattern}$/
      end

      def filter_releases(releases)
        releases.select do |release| 
          release.version <= Gem::Version.new(version)
        end
      end

      private

      def version
        query.match(self.class.pattern)[:version]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
structured_changelog-0.11.2 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.11.1 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.11.0 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.10.2 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.10.1 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.10.0 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.8.3 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.8.2 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.8.1 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.8.0 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb
structured_changelog-0.7.2 lib/structured_changelog/release_filters/matches_versions_less_than_or_equal_to.rb