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

Version Path
locomotive_cms-0.0.3.3 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.3.1 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2.9 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2.8 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2.7 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2.6 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2.5 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2.4 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2.3 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2.2 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2.1 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.2 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.1.4 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.1.3 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.1.2 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.1.1 lib/locomotive/liquid/filters/misc.rb
locomotive_cms-0.0.1 lib/locomotive/liquid/filters/misc.rb