Module: Compass::Core::SassExtensions::Functions::Env

### Home Classes Methods

### In Files

- lib/compass/core/sass_extensions/functions/env.rb

### Methods

- #at_stylesheet_root
- #compass_env
- #compass_extensions
- #current_date
- #current_output_file
- #current_source_file
- #current_time

### Class/Module Index

Quicksearch

- Compass
- Compass::BrowserSupport
- Compass::Configuration
- Compass::Configuration::Adapters
- Compass::Configuration::Data
- Compass::Configuration::Defaults
- Compass::Configuration::Inheritance
- Compass::Configuration::Inheritance::ClassMethods
- Compass::Configuration::Inheritance::ClassMethods::ArrayProxy
- Compass::Configuration::Inheritance::InstanceMethods
- Compass::Configuration::Paths
- Compass::Configuration::Watch
- Compass::Core
- Compass::Core::CanIUse
- Compass::Core::SassExtensions
- Compass::Core::SassExtensions::Functions
- Compass::Core::SassExtensions::Functions::Colors
- Compass::Core::SassExtensions::Functions::Configuration
- Compass::Core::SassExtensions::Functions::Constants
- Compass::Core::SassExtensions::Functions::CrossBrowserSupport
- Compass::Core::SassExtensions::Functions::CrossBrowserSupport::CSS2FallbackValue
- Compass::Core::SassExtensions::Functions::Display
- Compass::Core::SassExtensions::Functions::Enumerate
- Compass::Core::SassExtensions::Functions::Env
- Compass::Core::SassExtensions::Functions::Files
- Compass::Core::SassExtensions::Functions::FontFiles
- Compass::Core::SassExtensions::Functions::GradientSupport
- Compass::Core::SassExtensions::Functions::GradientSupport::Assertions
- Compass::Core::SassExtensions::Functions::GradientSupport::CSS3AngleToSVGConverter
- Compass::Core::SassExtensions::Functions::GradientSupport::ColorStop
- Compass::Core::SassExtensions::Functions::GradientSupport::Functions
- Compass::Core::SassExtensions::Functions::GradientSupport::Gradient
- Compass::Core::SassExtensions::Functions::GradientSupport::Gradient::ClassMethods
- Compass::Core::SassExtensions::Functions::GradientSupport::LinearGradient
- Compass::Core::SassExtensions::Functions::GradientSupport::RadialGradient
- Compass::Core::SassExtensions::Functions::ImageSize
- Compass::Core::SassExtensions::Functions::ImageSize::ImageProperties
- Compass::Core::SassExtensions::Functions::ImageSize::JPEG
- Compass::Core::SassExtensions::Functions::InlineImage
- Compass::Core::SassExtensions::Functions::Lists
- Compass::Core::SassExtensions::Functions::Math
- Compass::Core::SassExtensions::Functions::SassDeclarationHelper
- Compass::Core::SassExtensions::Functions::Selectors
- Compass::Core::SassExtensions::Functions::Urls
- Compass::Core::SassExtensions::Functions::Urls::FontUrl
- Compass::Core::SassExtensions::Functions::Urls::GeneratedImageUrl
- Compass::Core::SassExtensions::Functions::Urls::ImageUrl
- Compass::Core::SassExtensions::Functions::Urls::StylesheetUrl
- Compass::Error
- Compass::Frameworks
- Compass::Frameworks::Framework
- Compass::HasDeprecatedConstantsFromCore
- Compass::SassExtensions
- Compass::SassExtensions::Functions
- Compass::Util
- Sass
- Sass::Script
- Sass::Script::CrossBrowserFunctionCall
- Sass::Script::Funcall
- Sass::Script::Functions
- Sass::Script::Functions::EvaluationContext
- Sass::Script::HasSimpleCrossBrowserFunctionSupport
- Sass::Script::List
- Sass::Script::Value
- Sass::Script::Value::ArgList
- Sass::Script::Value::Base
- Sass::Script::Value::List
- Sass::Script::Value::Map
- Sass::Tree
- Sass::Tree::Node

No matching classes.

# Compass::Core::SassExtensions::Functions::Env

### Constants

DEFAULT_DATE
DEFAULT_TIME
NOT_ABSOLUTE

### Public Instance Methods

at_stylesheet_root() click to toggle source

    # File lib/compass/core/sass_extensions/functions/env.rb, line 66
    def at_stylesheet_root
      bool(environment.selector.nil?)
    end

compass_env() click to toggle source

    # File lib/compass/core/sass_extensions/functions/env.rb, line 5
    def compass_env
      compass_opts = options[:compass] || {}
      identifier((compass_opts[:environment] || "development").to_s)
    end

compass_extensions() click to toggle source

    # File lib/compass/core/sass_extensions/functions/env.rb, line 53
    def compass_extensions
      exts = Sass::Util.ordered_hash(identifier("compass") => quoted_string(Compass::Core::VERSION))
      if defined?(Compass::Frameworks::ALL)
        Compass::Frameworks::ALL.each do |framework|
          next if framework.name == "compass"
          exts[identifier(framework.name)] =
            framework.version ? quoted_string(framework.version) : bool(true);
        end
      end
      map(exts)
    end

current_date(format = DEFAULT_DATE) click to toggle source

    # File lib/compass/core/sass_extensions/functions/env.rb, line 20
    def current_date(format = DEFAULT_DATE)
      current_time(format)
    end

current_output_file(absolute = NOT_ABSOLUTE) click to toggle source

    # File lib/compass/core/sass_extensions/functions/env.rb, line 40
    def current_output_file(absolute = NOT_ABSOLUTE)
      if absolute.to_bool
        identifier(options[:css_filename].to_s)
      else
        filename = Pathname.new(options[:css_filename].to_s)
        css_path = Pathname.new(Compass.configuration.css_path)
        relative_filename = filename.relative_path_from(css_path).to_s rescue filename
        identifier(relative_filename.to_s)
      end
    end

current_source_file(absolute = NOT_ABSOLUTE) click to toggle source

    # File lib/compass/core/sass_extensions/functions/env.rb, line 27
    def current_source_file(absolute = NOT_ABSOLUTE)
      if absolute.to_bool
        identifier(options[:original_filename].to_s)
      else
        filename = Pathname.new(options[:original_filename].to_s)
        sass_path = Pathname.new(Compass.configuration.sass_path)
        relative_filename = filename.relative_path_from(sass_path).to_s rescue filename
        identifier(relative_filename.to_s)
      end
    end

current_time(format = DEFAULT_TIME) click to toggle source

    # File lib/compass/core/sass_extensions/functions/env.rb, line 12
    def current_time(format = DEFAULT_TIME)
      assert_type format, :String
      identifier(Time.now.strftime(format.value))
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.