Sha256: 2987648db956fec578450ce9e26e0b639dc80ae9ef3af2a310d0f7d95608ba09

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

module Archetype::SassExtensions::Styleguide

  private

  def memoizer
    Archetype::Functions::StyleguideMemoizer
  end

  #
  # normalize the styleguide definition into a hash representative of the definition
  #
  # *Parameters*:
  # - <tt>definition</tt> {String|List|Hash|Map} the styleguide definition
  # *Returns*:
  # - {Hash} the normalized hash representing the styleguide definition
  #
  def normalize_styleguide_definition(definition)
    # if it's not a map, we got a description, which we need to convert
    definition = get_styles([definition], nil, nil) if not definition.is_a?(Sass::Script::Value::Map)
     # now convert the map to a hash if needed
    definition = helpers.data_to_hash(definition) if not definition.is_a?(Hash)
    definition = resolve_runtime_locale_values(definition)
    return definition
  end

  def self.reset!(filename = nil)
    @@archetype_styleguide_mutex.synchronize do
      if filename.nil?
        @@styleguide_themes = {}
      else
        (@@styleguide_themes ||= {}).delete(filename.hash)
      end
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
archetype-1.0.0.alpha.2 lib/archetype/sass_extensions/functions/styleguide/helpers.rb
archetype-1.0.0.alpha.1 lib/archetype/sass_extensions/functions/styleguide/helpers.rb