Sha256: 392238af299b5709469bcd505238d07f2219a411fbaedb521451922d80fe7dd0
Contents?: true
Size: 649 Bytes
Versions: 17
Compression:
Stored size: 649 Bytes
Contents
module Locomotive module Liquid module Filters module Misc def underscore(input) input.to_s.gsub(' ', '_').gsub('/', '_').underscore end def dasherize(input) input.to_s.gsub(' ', '-').gsub('/', '-').dasherize end def concat(input, *args) result = input.to_s args.flatten.each { |a| result << a.to_s } result end def modulo(word, index, modulo) (index.to_i + 1) % modulo == 0 ? word : '' end end ::Liquid::Template.register_filter(Misc) end end end
Version data entries
17 entries across 17 versions & 1 rubygems