Sha256: 1d346db921f637dda74ae138ca814f269ce2a7a29c9cacd6c16005d096e2456f

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

module Clipster
  module ApplicationHelper
    def supported_languages
      languages = CodeRay::Scanners.all_plugins
      languages.delete(CodeRay::Scanners::Raydebug)
      languages.delete(CodeRay::Scanners::Debug)

      languages.sort{ |x,y| x.title <=> y.title } # sort by language title
    end

    def language_counts
      Clip.select("language, count(*) as count").public.group(:language)
    end

    def display_user_text(user)
      user.send(Clipster.config.user_display_attribute)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clipster-0.5.3 app/helpers/clipster/application_helper.rb