File: entypo-rails.rb

package info (click to toggle)
ruby-entypo-rails 3.0.0~pre~rc2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 484 kB
  • ctags: 24
  • sloc: ruby: 59; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 1,040 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'rails'
require 'entypo/version'

# The entypo-rails plugin provides access to the Entypo pictograms
# by Daniel Bruce http://www.entypo.com in the Rails asset pipeline.
module Entypo

  # String used as CSS Prefix before the icon name defined by entypo, this can
  # be set to avoid conflicts with other libraries like bootstrap.
  #
  # The default is "icon"
  @@css_prefix = "icon"
  mattr_accessor :css_prefix

  # Boolean which controls in which cases the route charmap route is drawn (or
  # not), when set to `true` the route is drawn.
  #
  # Defaults to `true` in Rails development env.
  @@charmap = Rails.env.development?
  mattr_accessor :charmap
  def self.charmap?; charmap end

  # Dummy engine so that lib/assets/stylesheets and vendor/assets/fonts
  # are picked up by Rails asset pipeline.
  class Engine < ::Rails::Engine
    config.root = '/usr/share/ruby-entypo-rails'
    initializer :assets do |config|
      Rails.application.config.assets.precompile += %w{ entypo.css } if Entypo.charmap?
    end
  end
end