Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

default_mime_type can just be a class method

  • Loading branch information...
commit 743c1b1a6433195e440e2d863e5d4767cc41271a 1 parent d93b48f
@josh josh authored
View
4 lib/sprockets/closure_compressor.rb
@@ -1,6 +1,8 @@
module Sprockets
class ClosureCompressor < Template
- self.default_mime_type = 'application/javascript'
+ def self.default_mime_type
+ 'application/javascript'
+ end
def render(context)
require 'closure-compiler' unless defined? ::Closure::Compiler
View
4 lib/sprockets/coffee_script_template.rb
@@ -1,6 +1,8 @@
module Sprockets
class CoffeeScriptTemplate < Template
- self.default_mime_type = 'application/javascript'
+ def self.default_mime_type
+ 'application/javascript'
+ end
def render(context)
require 'coffee_script' unless defined? ::CoffeeScript
View
4 lib/sprockets/jst_processor.rb
@@ -1,6 +1,8 @@
module Sprockets
class JstProcessor < Template
- self.default_mime_type = 'application/javascript'
+ def self.default_mime_type
+ 'application/javascript'
+ end
def self.default_namespace
'this.JST'
View
4 lib/sprockets/less_template.rb
@@ -1,6 +1,8 @@
module Sprockets
class LessTemplate < Template
- self.default_mime_type = 'text/css'
+ def self.default_mime_type
+ 'text/css'
+ end
def render(context)
require 'less' unless defined? ::Less
View
4 lib/sprockets/sass_compressor.rb
@@ -1,6 +1,8 @@
module Sprockets
class SassCompressor < Template
- self.default_mime_type = 'text/css'
+ def self.default_mime_type
+ 'text/css'
+ end
def render(context)
require 'sass' unless defined? ::Sass::Engine
View
4 lib/sprockets/sass_template.rb
@@ -1,7 +1,9 @@
module Sprockets
# Also see `SassImporter` for more infomation.
class SassTemplate < Template
- self.default_mime_type = 'text/css'
+ def self.default_mime_type
+ 'text/css'
+ end
def syntax
:sass
View
4 lib/sprockets/scss_template.rb
@@ -2,7 +2,9 @@
module Sprockets
class ScssTemplate < SassTemplate
- self.default_mime_type = 'text/css'
+ def self.default_mime_type
+ 'text/css'
+ end
def syntax
:scss
View
4 lib/sprockets/template.rb
@@ -2,10 +2,6 @@ module Sprockets
class Template
attr_reader :data
- class << self
- attr_accessor :default_mime_type
- end
-
def initialize(file, &block)
@data = block.call(self)
end
View
4 lib/sprockets/uglifier_compressor.rb
@@ -1,6 +1,8 @@
module Sprockets
class UglifierCompressor < Template
- self.default_mime_type = 'application/javascript'
+ def self.default_mime_type
+ 'application/javascript'
+ end
def render(context)
require 'uglifier' unless defined? ::Uglifier
Please sign in to comment.
Something went wrong with that request. Please try again.