Skip to content

Commit

Permalink
If scope is a Module/Class, treat as scope_class
Browse files Browse the repository at this point in the history
This is more useful than using Module/Class as the scope_class.
  • Loading branch information
jeremyevans authored and judofyr committed Sep 23, 2019
1 parent dbb4df9 commit be625c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tilt/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def prepare
def evaluate(scope, locals, &block)
locals_keys = locals.keys
locals_keys.sort!{|x, y| x.to_s <=> y.to_s}
method = compiled_method(locals_keys, scope.class)
method = compiled_method(locals_keys, scope.is_a?(Module) ? scope : scope.class)
method.bind(scope).call(locals, &block)
end

Expand Down

0 comments on commit be625c8

Please sign in to comment.