Sha256: 6abeca3fc67cc56fdcc6a4a45f2d5e58d5ffc90f2cb4063ed3ff766b7f145eb4

Contents?: true

Size: 830 Bytes

Versions: 62

Compression:

Stored size: 830 Bytes

Contents

module Workarea
  module Plugin
    module AssetAppendsHelper
      def append_stylesheets(name)
        appends = Plugin.skip_appends(
          Plugin.stylesheets_appends[name],
          Workarea.config.skip_stylesheets
        )

        return '' if appends.blank?

        appends.inject([]) do |arr, paths|
          Array(paths).each do |path|
            arr << "@import '#{path}';"
          end
          arr
        end.join("\n")
      end

      def append_javascripts(name)
        appends = Plugin.skip_appends(
          Plugin.javascripts_appends[name],
          Workarea.config.skip_javascripts
        )

        return [] if appends.blank?

        appends.inject([]) do |arr, paths|
          Array(paths).each do |path|
            require_asset(path)
          end
        end
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.15 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.4.36 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.14 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.4.35 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.13 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.4.34 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.12 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.4.33 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.11 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.10 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.4.32 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.9 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.4.31 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.8 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.4.30 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.7 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.4.29 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.6 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.4.28 lib/workarea/plugin/asset_appends_helper.rb
workarea-core-3.5.5 lib/workarea/plugin/asset_appends_helper.rb