Sha256: e4773c4ff520fb2eaa946d4bb024cfff4f7391da0095aaeb0d2f6924309ccce5
Contents?: true
Size: 1.46 KB
Versions: 13
Compression:
Stored size: 1.46 KB
Contents
# encoding: utf-8 module Middleman module Presentation # All methods needed to compare slides module ComparableSlide include Comparable # Needs to be implemented to make the other methods work def path fail MethodNotImplemented end # Needs to be implemented to make the other methods work def base_name fail MethodNotImplemented end # Needs to be implemented to make the other methods work def group fail MethodNotImplemented end # @private def <=>(other) path <=> other.path end # @private def eql?(other) path.eql? other.path end # Is slide similar to another slide def similar?(other) return true if eql? other base_name?(other.base_name) && group?(other.group) end # @private def hash path.hash end # Checks if slide is in group def group?(g) group == g end # Check if string/regex matches path def match?(string_or_regex) regex = if string_or_regex.is_a? String Regexp.new(string_or_regex) else string_or_regex end # rubocop:disable Style/CaseEquality regex === relative_path.to_s # rubocop:enable Style/CaseEquality end # Check if basename is equal def base_name?(b) base_name == b end end end end
Version data entries
13 entries across 13 versions & 1 rubygems