Sha256: c9494cdb8a3eefd98714459cdb8a5b4d0e33faeb41a7a7d6baf0428abab3774d

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

class Assette::Reader::Js < Assette::Reader(:js)
  
  def compile
    @file.text
  end
  
  class << self
    
    def error str, path=nil
      if path
        <<-JS
        console.group("Compiling Error in file #{path}");
        console.error(#{str.to_json});
        console.groupEnd();
        JS
      else
        "console.error(#{str.to_json});"
      end
    end
    
    def comment_str
      '// %s'
    end
    
    def tag path
      <<-HTML
        <script src="#{path}" type="text/javascript"></script>
      HTML
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
assette-0.0.6 lib/assette/readers/js.rb