module Searchkit::Rails

Constants

VERSION

Public Class Methods

assets_path() click to toggle source
# File lib/searchkit/rails.rb, line 31
def assets_path
  @assets_path ||= File.join gem_path, 'lib/assets'
end
compass?() click to toggle source
# File lib/searchkit/rails.rb, line 40
def compass?
  defined?(::Compass::Frameworks)
end
gem_path() click to toggle source

Paths

# File lib/searchkit/rails.rb, line 23
def gem_path
  @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
end
load!() click to toggle source
# File lib/searchkit/rails.rb, line 8
def load!
  register_compass_extension if compass?

  if rails?
    register_rails_engine
  elsif lotus?
    register_lotus
  elsif sprockets?
    register_sprockets
  end

  configure_sass
end
lotus?() click to toggle source
# File lib/searchkit/rails.rb, line 48
def lotus?
  defined?(::Lotus)
end
rails?() click to toggle source
# File lib/searchkit/rails.rb, line 44
def rails?
  defined?(::Rails)
end
sprockets?() click to toggle source

Environment detection helpers

# File lib/searchkit/rails.rb, line 36
def sprockets?
  defined?(::Sprockets)
end
stylesheets_path() click to toggle source
# File lib/searchkit/rails.rb, line 27
def stylesheets_path
  File.join assets_path, 'stylesheets'
end

Private Class Methods

configure_sass() click to toggle source
# File lib/searchkit/rails.rb, line 54
def configure_sass
  require 'sass'

  ::Sass.load_paths << stylesheets_path

  ::Sass::Script::Number.precision = [8, ::Sass::Script::Number.precision].max
end
register_compass_extension() click to toggle source
# File lib/searchkit/rails.rb, line 62
def register_compass_extension
  ::Compass::Frameworks.register(
    'bootstrap',
    :version               => Bootstrap::VERSION,
    :path                  => gem_path,
    :stylesheets_directory => stylesheets_path,
    :templates_directory   => File.join(gem_path, 'lib/generators/templates')
  )
end
register_lotus() click to toggle source
# File lib/searchkit/rails.rb, line 76
def register_lotus
  Lotus::Assets.sources << assets_path
end
register_rails_engine() click to toggle source
# File lib/searchkit/rails.rb, line 72
def register_rails_engine
  require 'searchkit/rails/engine'
end