<commit_before>module Jammit

  # The Jammit::Helper module, which is made available to every view, provides
  # helpers for writing out HTML tags for asset packages. In development you
  # get the ordered list of source files -- in any other environment, a link
  # to the cached packages.
  module Helper

    DATA_URI_START = "<!--[if (!IE)|(gte IE 8)]><!-->"
    DATA_URI_END   = "<!--<![endif]-->"
    MHTML_START    = "<!--[if lte IE 7]>"
    MHTML_END      = "<![endif]-->"

    # If embed_assets is turned on, writes out links to the Data-URI and MHTML
    # versions of the stylesheet package, otherwise the package is regular
    # compressed CSS, and in development the stylesheet URLs are passed verbatim.
    def include_stylesheets(*packages)
      options = packages.extract_options!
      return individual_stylesheets(packages, options) unless Jammit.package_assets
      return packaged_stylesheets(packages, options) if options.delete(:embed_assets) == false || !Jammit.embed_assets
      return embedded_image_stylesheets(packages, options)
    end

    # Writes out the URL to the bundled and compressed javascript package,
    # except in development, where it references the individual scripts.
    def include_javascripts(*packages)
      tags = packages.map do |pack|
        Jammit.package_assets ? Jammit.asset_url(pack, :js) : Jammit.packager.individual_urls(pack.to_sym, :js)
      end
      javascript_include_tag(tags.flatten)
    end

    # Writes out the URL to the concatenated and compiled JST file -- we always
    # have to pre-process it, even in development.
    def include_templates(*packages)
      javascript_include_tag(packages.map {|pack| Jammit.asset_url(pack, :jst) })
    end


    private<commit_msg>embed_assets or embed_images for disabling stylesheets<commit_after>module Jammit

  # The Jammit::Helper module, which is made available to every view, provides
  # helpers for writing out HTML tags for asset packages. In development you
  # get the ordered list of source files -- in any other environment, a link
  # to the cached packages.
  module Helper

    DATA_URI_START = "<!--[if (!IE)|(gte IE 8)]><!-->"
    DATA_URI_END   = "<!--<![endif]-->"
    MHTML_START    = "<!--[if lte IE 7]>"
    MHTML_END      = "<![endif]-->"

    # If embed_assets is turned on, writes out links to the Data-URI and MHTML
    # versions of the stylesheet package, otherwise the package is regular
    # compressed CSS, and in development the stylesheet URLs are passed verbatim.
    def include_stylesheets(*packages)
      options = packages.extract_options!
      return individual_stylesheets(packages, options) unless Jammit.package_assets
      disabled = (options.delete(:embed_assets) == false) || (options.delete(:embed_images) == false)
      return packaged_stylesheets(packages, options) if disabled || !Jammit.embed_assets
      return embedded_image_stylesheets(packages, options)
    end

    # Writes out the URL to the bundled and compressed javascript package,
    # except in development, where it references the individual scripts.
    def include_javascripts(*packages)
      tags = packages.map do |pack|
        Jammit.package_assets ? Jammit.asset_url(pack, :js) : Jammit.packager.individual_urls(pack.to_sym, :js)
      end
      javascript_include_tag(tags.flatten)
    end

    # Writes out the URL to the concatenated and compiled JST file -- we always
    # have to pre-process it, even in development.
    def include_templates(*packages)
      javascript_include_tag(packages.map {|pack| Jammit.asset_url(pack, :jst) })
    end


    private
{'fraction_non_alphanumeric': 0.09050650429006366, 'fraction_numerical': 0.0011071132023249377, 'mean_word_length': 3.540201005025126, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7279354', 'n_tokens_mistral': 1055, 'n_tokens_neox': 992, 'n_words': 356}