Module: Compass

Extended by:
Configuration::Helpers, Version
Defined in:
lib/compass/app_integration/merb/runtime.rb,
lib/compass.rb,
lib/compass.rb,
lib/compass/stats.rb,
lib/compass/errors.rb,
lib/compass/logger.rb,
lib/compass/actions.rb,
lib/compass/version.rb,
lib/compass/compiler.rb,
lib/compass/test_case.rb,
lib/compass/frameworks.rb,
lib/compass/grid_builder.rb,
lib/compass/commands/base.rb,
lib/compass/commands/help.rb,
lib/compass/configuration.rb,
lib/compass/app_integration.rb,
lib/compass/installers/base.rb,
lib/compass/configuration/data.rb,
lib/compass/installers/manifest.rb,
lib/compass/commands/interactive.rb,
lib/compass/app_integration/rails.rb,
lib/compass/commands/project_base.rb,
lib/compass/configuration/helpers.rb,
lib/compass/commands/print_version.rb,
lib/compass/commands/project_stats.rb,
lib/compass/commands/stamp_pattern.rb,
lib/compass/commands/watch_project.rb,
lib/compass/configuration/adapters.rb,
lib/compass/configuration/comments.rb,
lib/compass/configuration/defaults.rb,
lib/compass/commands/create_project.rb,
lib/compass/commands/update_project.rb,
lib/compass/commands/list_frameworks.rb,
lib/compass/commands/validate_project.rb,
lib/compass/configuration/inheritance.rb,
lib/compass/installers/bare_installer.rb,
lib/compass/commands/installer_command.rb,
lib/compass/app_integration/stand_alone.rb,
lib/compass/configuration/serialization.rb,
lib/compass/installers/template_context.rb,
lib/compass/commands/write_configuration.rb,
lib/compass/installers/manifest_installer.rb,
lib/compass/app_integration/rails/installer.rb,
lib/compass/commands/generate_grid_background.rb,
lib/compass/app_integration/stand_alone/installer.rb,
lib/compass/app_integration/rails/configuration_defaults.rb,
lib/compass/app_integration/stand_alone/configuration_defaults.rb

Overview

To configure Merb to use compass do the following:

Add dependencies to config/dependencies.rb

dependency “haml”, “>=2.2.0” dependency “merb-haml”, merb_gems_version dependency “chriseppstein-compass”, :require_as => ‘compass’

To use a different sass stylesheets locations as is recommended by compass add this configuration to your configuration block:

Merb::BootLoader.before_app_loads do

Merb::Plugins.config[:compass] = {
  :stylesheets => "app/stylesheets",
  :compiled_stylesheets => "public/stylesheets/compiled"
}

end

Defined Under Namespace

Modules: Actions, AppIntegration, Commands, Configuration, Exec, Frameworks, Installers, SassExtensions, Stats, Version Classes: Compiler, Error, FilesystemConflict, GridBuilder, Logger, MissingDependency, NullLogger, TestCase

Constant Summary collapse

VERSION =
"#{version[:major]}.#{version[:minor]}.#{version[:patch]}"
RAILS_LOADED =
true

Constants included from Configuration::Helpers

Configuration::Helpers::KNOWN_CONFIG_LOCATIONS

Instance Attribute Summary

Attributes included from Version

#version

Class Method Summary collapse

Methods included from Configuration::Helpers

add_configuration, add_project_configuration, configuration, configuration_for, configure_sass_plugin!, default_configuration, deprojectize, detect_configuration_file, projectize, reset_configuration!, sass_engine_options, sass_plugin_configuration, sass_plugin_configured?

Class Method Details

.base_directoryObject



11
12
13
# File 'lib/compass.rb', line 11

def base_directory
  File.expand_path(File.join(File.dirname(__FILE__), '..'))
end

.lib_directoryObject



14
15
16
# File 'lib/compass.rb', line 14

def lib_directory
  File.expand_path(File.join(File.dirname(__FILE__)))
end

.setup_template_locationObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/compass/app_integration/merb/runtime.rb', line 21

def self.setup_template_location
  # default the compass configuration if they didn't set it up yet.
  Merb::Plugins.config[:compass] ||= {}

  # default sass stylesheet location unless configured to something else
  Merb::Plugins.config[:compass][:stylesheets] ||= Merb.dir_for(:stylesheet) / "sass"

  # default sass css location unless configured to something else
  Merb::Plugins.config[:compass][:compiled_stylesheets] ||= Merb.dir_for(:stylesheet)

  #define the template hash for the project stylesheets as well as the framework stylesheets.
  template_location = {
    Merb::Plugins.config[:compass][:stylesheets] => Merb::Plugins.config[:compass][:compiled_stylesheets]
  }
  Compass::Frameworks::ALL.each do |framework|
    template_location[framework.stylesheets_directory] = Merb::Plugins.config[:compass][:compiled_stylesheets]
  end

  # merge existing template locations if present
  if Merb::Plugins.config[:sass][:template_location].is_a?(Hash)
    template_location.merge!(Merb::Plugins.config[:sass][:template_location])
    Merb::Plugins.config[:sass][:template_location] = template_location
  end

  #configure Sass to know about all these sass locations.
  Sass::Plugin.options[:template_location] = template_location
end