module SprocketsIIFE::Utils

Public Class Methods

build_iife_path(script_path) click to toggle source
# File lib/sprockets-iife/utils.rb, line 18
def build_iife_path(script_path)
  File.join(File.dirname(script_path), "#{File.basename(script_path, '.*')}-iife.js.erb")
end
bundle?(script_name_or_path) click to toggle source
# File lib/sprockets-iife/utils.rb, line 7
def bundle?(script_name_or_path)
  script_name = "#{File.basename(script_name_or_path, '.*')}.js"
  Rails.application.config.assets.precompile.any? do |x|
    case x
      when String then x == script_name
      when Regexp then x =~ script_name
      else false
    end
  end
end