Sha256: 51e072b641767749d1f93968973091cae27594745524f4af2444573b3ca242d1

Contents?: true

Size: 323 Bytes

Versions: 4

Compression:

Stored size: 323 Bytes

Contents

require "digest/sha1"

module HtmlPress
  CONTENT_CACHE = {}

  def self.js_compressor (text, options = nil)
    options ||= {}
    options[:output] ||= {inline_script: true}

    hash = Digest::SHA1.hexdigest(text)
    CONTENT_CACHE[hash] ||= MultiJs.compile(text, options).gsub(/;$/,'')
    CONTENT_CACHE[hash]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
troy-0.0.35 lib/troy/hacks.rb
troy-0.0.34 lib/troy/hacks.rb
troy-0.0.33 lib/troy/hacks.rb
troy-0.0.32 lib/troy/hacks.rb