module FruitWarehouse

Constants

VERSION

Public Class Methods

assets_path() click to toggle source
# File lib/fruit_warehouse.rb, line 28
def assets_path
  @assets_path ||= File.join(gem_path, 'assets')
end
compass?() click to toggle source
# File lib/fruit_warehouse.rb, line 37
def compass?
  defined?(::Compass)
end
fonts_path() click to toggle source
# File lib/fruit_warehouse.rb, line 24
def fonts_path
  File.join(assets_path, 'fonts')
end
gem_path() click to toggle source

Paths

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

  if rails?
    register_rails_engine
  elsif sprockets?
    register_sprockets
  end

  configure_sass
end
rails?() click to toggle source
# File lib/fruit_warehouse.rb, line 41
def rails?
  defined?(::Rails)
end
sprockets?() click to toggle source

Environment detection helpers

# File lib/fruit_warehouse.rb, line 33
def sprockets?
  defined?(::Sprockets)
end
stylesheets_path() click to toggle source
# File lib/fruit_warehouse.rb, line 20
def stylesheets_path
  File.join(assets_path, 'stylesheets')
end

Private Class Methods

configure_sass() click to toggle source
# File lib/fruit_warehouse.rb, line 51
def configure_sass
  require 'sass'

  ::Sass.load_paths << stylesheets_path
end
register_compass_extension() click to toggle source
# File lib/fruit_warehouse.rb, line 57
def register_compass_extension
  require "fruit_warehouse/version"

  ::Compass::Frameworks.register(
      'fruit_warehouse',
      :version               => FruitWarehouse::VERSION,
      :path                  => gem_path,
      :stylesheets_directory => stylesheets_path,
      :templates_directory   => File.join(gem_path, 'templates')
  )
end
register_rails_engine() click to toggle source
# File lib/fruit_warehouse.rb, line 69
def register_rails_engine
  require 'sass-rails'
  require 'fruit_warehouse/rails/engine'
  require 'fruit_warehouse/rails/railtie'
end
register_sprockets() click to toggle source
# File lib/fruit_warehouse.rb, line 75
def register_sprockets
  Sprockets.append_path(stylesheets_path)
  Sprockets.append_path(fonts_path)
end