Sha256: 717b9a562cca3584014ac2a2c71791a7104d974de7a97b7881845d3485c67dee

Contents?: true

Size: 468 Bytes

Versions: 5

Compression:

Stored size: 468 Bytes

Contents

class AssetFormat::Js < AssetFormat
  CONTENT_TYPE = 'text/javascript'
  IMPORT = /[\/\*]{2}\s*@import[ "'\(]+([^\s"'\);]+)[\s"'\);]*(\*\/)?/
  IMPORT_COFFEE = /# *@import[ "'\(]+([^\s"'\);]+)[ "'\)]*/
  EXTEND_FORMATS = [:coffee]

  def minify text
    ::Uglifier.compile text, copyright: false
  end

  def coffee text
    text = text.gsub(IMPORT_COFFEE){ |s|
      "\n### @import #{IMPORT_COFFEE.match(s)[1]}\n###\n"
    }
    ::CoffeeScript.compile text
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
zfben_rails_assets-0.0.13 app/models/asset_format/js.rb
zfben_rails_assets-0.0.12 app/models/asset_format/js.rb
zfben_rails_assets-0.0.11 app/models/asset_format/js.rb
zfben_rails_assets-0.0.10 app/models/asset_format/js.rb
zfben_rails_assets-0.0.9 app/models/asset_format/js.rb