Sha256: a0e0f5678bbecdf1e150975cf36512a23d243ba45f2d8671036fef01e2a0da6a
Contents?: true
Size: 1.22 KB
Versions: 15
Compression:
Stored size: 1.22 KB
Contents
module Locomotive module Wagon module Liquid module Filters module Text # right justify and padd a string def rjust(input, integer, padstr = '') input.to_s.rjust(integer, padstr) end # left justify and padd a string def ljust(input, integer, padstr = '') input.to_s.ljust(integer, padstr) end def underscore(input) input.to_s.gsub(' ', '_').gsub('/', '_').underscore end def dasherize(input) input.to_s.gsub(' ', '-').gsub('/', '-').dasherize end # alias newline_to_br def multi_line(input) input.to_s.gsub("\n", '<br/>') end def concat(input, *args) result = input.to_s args.flatten.each { |a| result << a.to_s } result end def encode(input) Rack::Utils.escape(input) end def textile(input) ::RedCloth.new(input).to_html end def markdown(input) Locomotive::Wagon::Markdown.render(input) end end ::Liquid::Template.register_filter(Text) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems