Sha256: b20e4c2653af536634f916cd0d188b8162379efc1d4cb27bcb3f7fd99ea25b6c

Contents?: true

Size: 350 Bytes

Versions: 20

Compression:

Stored size: 350 Bytes

Contents

module Distil
  
  class JavascriptFile < SourceFile
    extension 'js'
    content_type 'js'
    
    def can_embed_as_content(file)
      [".css", ".html", ".json"].include?(file.extension)
    end

    def escape_embeded_content(content)
      content.gsub("\\", "\\\\").gsub("\n", "\\n").gsub("\"", "\\\"").gsub("'", "\\\\'")
    end

  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
distil-0.13.6 lib/distil/source-file/javascript-file.rb
distil-0.13.5 lib/distil/source-file/javascript-file.rb
distil-0.13.4 lib/distil/source-file/javascript-file.rb
distil-0.13.3 lib/distil/source-file/javascript-file.rb
distil-0.13.2 lib/distil/source-file/javascript-file.rb
distil-0.13.1 lib/distil/source-file/javascript-file.rb
distil-0.13.0 lib/distil/source-file/javascript-file.rb
distil-0.12.6 lib/distil/source-file/javascript-file.rb
distil-0.12.4 lib/distil/source-file/javascript-file.rb
distil-0.12.3 lib/distil/source-file/javascript-file.rb
distil-0.12.2 lib/distil/source-file/javascript-file.rb
distil-0.12.1 lib/distil/source-file/javascript-file.rb
distil-0.12.0 lib/distil/source-file/javascript-file.rb
distil-0.11.8 lib/distil/source-file/javascript-file.rb
distil-0.11.6 lib/distil/source-file/javascript-file.rb
distil-0.11.5 lib/distil/source-file/javascript-file.rb
distil-0.11.4 lib/distil/source-file/javascript-file.rb
distil-0.11.3 lib/distil/source-file/javascript-file.rb
distil-0.11.1 lib/distil/source-file/javascript-file.rb
distil-0.11.0 lib/distil/source-file/javascript-file.rb