module Licensee::ContentHelper

Constants

DIGEST

Public Instance Methods

content_normalized() click to toggle source
# File lib/licensee/content_helper.rb, line 18
def content_normalized
  return unless content
  @content_normalized ||= begin
    content_normalized = content.downcase.strip
    content_normalized.gsub!(/^#{Matchers::Copyright::REGEX}$/i, '')
    content_normalized.tr("\n", ' ').squeeze(' ')
  end
end
hash() click to toggle source
# File lib/licensee/content_helper.rb, line 14
def hash
  @hash ||= DIGEST.hexdigest content_normalized
end
wordset() click to toggle source
# File lib/licensee/content_helper.rb, line 8
def wordset
  @wordset ||= if content_normalized
    content_normalized.scan(/[\w']+/).to_set
  end
end