Sha256: a001f9aa19051cf5a00c864d0a5dac14aa58e3d92c974503ed074e667f47845a

Contents?: true

Size: 1.16 KB

Versions: 69

Compression:

Stored size: 1.16 KB

Contents

# Compact function pulled from compass
require 'sass'
module Sass::Script::Functions
  module CustomSassExtensions
    def compact(*args)
      sep = :comma
      if args.size == 1 && args.first.is_a?(Sass::Script::List)
        args = args.first.value
        sep = args.first.separator
      end
      Sass::Script::List.new(args.reject{|a| !a.to_bool}, sep)
    end
  end
  include CustomSassExtensions
end

module Sprockets
  class AssetAttributes
    def search_paths
      paths = [pathname.to_s]

      path_without_extensions = extensions.inject(pathname) { |p, ext| p.sub(ext, '') }

      # optimization: component.json can only be nested one level deep
      if !path_without_extensions.to_s.index('/')
        paths << path_without_extensions.join('component.json').to_s
      end

      if pathname.basename(extensions.join).to_s != 'index'
        paths << path_without_extensions.join("index#{extensions.join}").to_s
      end

      if paths[0] !~ /\/assets\/_?(js|css|img)\// and paths[0] =~ /^(\/?[^\/]+)(\/.+)$/
        paths << $1 + '/assets/css' +$2
        paths << $1 + '/assets/js'  +$2
        paths << $1 + '/assets/img' +$2
      end

      paths
    end
  end

end

Version data entries

69 entries across 69 versions & 2 rubygems

Version Path
fanforce-plugin-factory-2.0.0.rc29 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc28 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc27 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc26 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc25 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc24 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc23 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc22 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc21 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc19 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc18 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc17 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc16 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc15 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc13 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc12 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc11 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc10 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc9 lib/fanforce/plugin_factory/sprockets/hacks.rb
fanforce-plugin-factory-2.0.0.rc8 lib/fanforce/plugin_factory/sprockets/hacks.rb