FEATURE: upgrade sprockets to latest stable
This unlocks Rails upgrades, so we can now upgrade to latest Rails
This commit is contained in:
parent
c381086314
commit
6e5296a510
|
@ -358,10 +358,10 @@ GEM
|
||||||
spork-rails (4.0.0)
|
spork-rails (4.0.0)
|
||||||
rails (>= 3.0.0, < 5)
|
rails (>= 3.0.0, < 5)
|
||||||
spork (>= 1.0rc0)
|
spork (>= 1.0rc0)
|
||||||
sprockets (3.6.3)
|
sprockets (3.7.1)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (3.1.1)
|
sprockets-rails (3.2.0)
|
||||||
actionpack (>= 4.0)
|
actionpack (>= 4.0)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
require 'sprockets'
|
require 'sprockets'
|
||||||
|
|
||||||
Sprockets.register_engine '.es6', Tilt::ES6ModuleTranspilerTemplate
|
Sprockets.register_mime_type 'application/ecmascript6', extensions: ['.es6', '.js.es6'], charset: :unicode
|
||||||
|
Sprockets.register_transformer 'application/ecmascript6', 'application/javascript', Tilt::ES6ModuleTranspilerTemplate
|
||||||
|
|
|
@ -10,6 +10,15 @@ module Tilt
|
||||||
@mutex = Mutex.new
|
@mutex = Mutex.new
|
||||||
@ctx_init = Mutex.new
|
@ctx_init = Mutex.new
|
||||||
|
|
||||||
|
def self.call(input)
|
||||||
|
filename = input[:filename]
|
||||||
|
source = input[:data]
|
||||||
|
context = input[:environment].context_class.new(input)
|
||||||
|
|
||||||
|
result = new(filename){source}.render(context)
|
||||||
|
context.metadata.merge(data: result)
|
||||||
|
end
|
||||||
|
|
||||||
def prepare
|
def prepare
|
||||||
# intentionally left empty
|
# intentionally left empty
|
||||||
# Tilt requires this method to be defined
|
# Tilt requires this method to be defined
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
class SourceURL < Tilt::Template
|
class SourceURL < Tilt::Template
|
||||||
self.default_mime_type = 'application/javascript'
|
self.default_mime_type = 'application/javascript'
|
||||||
|
|
||||||
|
def self.call(input)
|
||||||
|
filename = input[:filename]
|
||||||
|
source = input[:data]
|
||||||
|
context = input[:environment].context_class.new(input)
|
||||||
|
|
||||||
|
result = new(filename){source}.render(context)
|
||||||
|
context.metadata.merge(data: result)
|
||||||
|
end
|
||||||
|
|
||||||
def prepare
|
def prepare
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue