Skip to content

Commit

Permalink
Implicitly require 'opal-haml' when a haml template is required
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Jan 8, 2014
1 parent ea15b55 commit 39632b8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
@@ -1,7 +1,11 @@
## edge

* Implicitly require `opal-haml` when any haml template is required

## 0.2.0 2013-12-17

* Remove opal-sprockets dependency
* Remove opal-sprockets dependency

## 0.1.0 2013-12-17

* Initial release
* Initial release
3 changes: 2 additions & 1 deletion Gemfile
@@ -1,4 +1,5 @@
source 'https://rubygems.org'
gemspec

gem 'opal', '~> 0.5.0'
gem 'opal', :github => 'opal/opal'
gem 'opal-rspec', '0.3.0.beta2'
5 changes: 3 additions & 2 deletions lib/opal/haml/processor.rb
Expand Up @@ -17,8 +17,9 @@ def initialize_engine
def prepare
end

def evaluate(scope, locals, &block)
Opal::Haml.compile data, scope.logical_path.sub(/^templates\//, '')
def evaluate(context, locals, &block)
context.require_asset 'opal-haml'
Opal::Haml.compile data, context.logical_path.sub(/^templates\//, '')
end
end
end
Expand Down
2 changes: 0 additions & 2 deletions spec/haml_spec.rb
@@ -1,5 +1,3 @@
require 'opal-haml'

require File.expand_path('../simple', __FILE__)
require File.expand_path('../advanced', __FILE__)
require File.expand_path('../html_content', __FILE__)
Expand Down

0 comments on commit 39632b8

Please sign in to comment.