module 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