From f749961d9717efb5a055bfee23ae9dd1e8aaaa13 Mon Sep 17 00:00:00 2001 From: Godfrey Chan Date: Wed, 15 Oct 2014 01:23:29 -0700 Subject: [PATCH] `Sprockets::Context` takes a `Pathname` for its third argument As far as I can tell, sprockets has always expected the third argument to be a `Pathname` object. Not sure what actually changed and why it was working before, but it now throws a `NoMethodError` for `dirname` on `String` in `Context#resolve` # , not sure why this was working before --- lib/sass/discourse_sass_compiler.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/sass/discourse_sass_compiler.rb b/lib/sass/discourse_sass_compiler.rb index ec8d729fc28..ebb799ecc8d 100644 --- a/lib/sass/discourse_sass_compiler.rb +++ b/lib/sass/discourse_sass_compiler.rb @@ -1,4 +1,5 @@ require_dependency 'sass/discourse_sass_importer' +require 'pathname' class DiscourseSassCompiler @@ -41,7 +42,8 @@ class DiscourseSassCompiler env = env.instance_variable_get('@environment') end - context = env.context_class.new(env, "#{@target}.scss", "app/assets/stylesheets/#{@target}.scss") + pathname = Pathname.new("app/assets/stylesheets/#{@target}.scss") + context = env.context_class.new(env, "#{@target}.scss", pathname) debug_opts = Rails.env.production? ? {} : { line_numbers: true,