Sha256: f0cc8e7c853e58b379d400bbdfb6d2e8d7f9ec1816e0a673426beaa6e115605c

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

require 'grandstand/application'

module Grandstand
  autoload(:Controller, 'grandstand/controller')
  autoload(:Helper, 'grandstand/helper')

  def self.initialize!(config = nil)
    if defined?(ActionController)
      ActionController::Base.send :include, Grandstand::Controller
      if Rails.env.development?
        ActionController::Base.send :include, Grandstand::Controller::Development
        # Tell Less to produce the smallest stylesheets it's capable of
        Less::More.compression = true
        Less::More.header = false
        # Point More to our plugins' source_path and our custom admin stylesheets folder
        Less::More.source_path = File.join('vendor', 'plugins', 'grandstand', 'app', 'stylesheets')
        Less::More.destination_path = File.join('admin', 'stylesheets')
      end
    end
    if defined?(ActionView)
      ActionView::Base.send :include, Grandstand::Helper
    end
    Paperclip.interpolates :padded_id do |attachment, style|
      attachment.instance.id.to_s.rjust(6, '0')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
grandstand-0.2.3 lib/grandstand.rb
grandstand-0.2.2 lib/grandstand.rb
grandstand-0.2.1 lib/grandstand.rb