Skip to content

Commit

Permalink
Implicitly require erb from stdlib when including erb templates
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Jan 8, 2014
1 parent cb33850 commit 7765739
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -100,7 +100,9 @@

* Add `Math` module to corelib.

* Use `//#` instead of `//@` deprecated syntax for sourceMappingURL
* Use `//#` instead of `//@` deprecated syntax for sourceMappingURL.

* Implicitly require `erb` from stdlib when including erb templates.

## 0.5.5 2013-11-25

Expand Down
5 changes: 3 additions & 2 deletions lib/opal/sprockets/erb.rb
Expand Up @@ -18,8 +18,9 @@ def initialize_engine
def prepare
end

def evaluate(scope, locals, &block)
Opal::ERB.compile data, scope.logical_path.sub(/^templates\//, '')
def evaluate(context, locals, &block)
context.require_asset 'erb'
Opal::ERB.compile data, context.logical_path.sub(/^templates\//, '')
end
end
end
Expand Down

0 comments on commit 7765739

Please sign in to comment.