Open magynhard opened 8 years ago
Yes, here's the catch: opal-haml only works with the sprockets-based stack:
https://github.com/opal/opal/blob/master/docs/using_sprockets.md#opal--sprockets
Something more or less like the following:
require 'sprockets'
environment = Sprockets::Environment.new
require 'opal'
require 'opal-haml'
Opal.append_path "app"
Opal.append_path "app/views"
Opal.append_path "app/class"
Opal.paths.each do |path|
environment.append_path path
end
File.binwrite "public/lib/app.js", environment['application.js'].to_s
I unfortunately don't get it work.
So i just created a repo for this here: https://github.com/entwanderer/opal-haml-test
There I'm currently using the .opalerb-template and it builds fine with rake build
By renaming "example" to "exmaple2" (on require and @ Template[...]) in app/application.rb it should use the example2.haml, but I still get the same error as posted before when executing rake build
Do you have an idea?
Hi there,
I'm playing with ruby at the moment and decided to do with opal.
With *.opalerb templates everything works fine. But I wanted to use haml templates, but it does not work.
Seems that what u call to "add *.haml" to sprockets does not work. Maybe a Windows related problem?
Here is my sample app:
I added opal-haml to the Gemfile and did bundle install. I tried the gem from rubygems as well as the github version. The behaviour is the same.
This is my rakefile
When i execute rake build i get the following output:
Ruby x64 @ Win7 x64
Any idea?