Sha256: 13c2f1704a29174209fa811fc3a53d881c70b7a82d587fe5c64d310bddbf63ba
Contents?: true
Size: 572 Bytes
Versions: 40
Compression:
Stored size: 572 Bytes
Contents
# frozen_string_literal: true module Geet module Helpers module SummaryHelper # Split the summary in title and description. # The description is optional, but the title mandatory. # def split_summary(summary) raise "Missing title in summary!" if summary.to_s.strip.empty? title, description = summary.split(/\r|\n/, 2) # The title may have a residual newline char; the description may not be present, # or have multiple blank lines. [title.strip, description.to_s.strip] end end end end
Version data entries
40 entries across 40 versions & 1 rubygems