lib/jade-rails/sprockets/transformer.rb in pug-rails-3.0.0.rc3 vs lib/jade-rails/sprockets/transformer.rb in pug-rails-3.0.0
- old
+ new
@@ -2,10 +2,11 @@
# frozen_string_literal: true
require "digest/sha1"
module Jade
+ # :nodoc:
module Sprockets
class << self
def compile(source, options = {})
Jade.compile(source, options)
end
@@ -14,12 +15,12 @@
#
# Friendly with sprockets 2.x, 3.x, and 4.x.
# https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
#
class Transformer
- def initialize(filename, &block)
+ def initialize(filename)
@filename = filename
- @source = block.call
+ @source = yield
end
def render(context, _)
self.class.run(@filename, @source, context)
end