Closed mibamur closed 8 years ago
https://github.com/opal/opal-rails/blob/master/lib/opal/rails/haml_filter.rb#L1
module Haml::Filters::Opal
include Haml::Filters::Base
...
Filters implemented with Haml::Filters::Base
can't be used for Hamlit. You should re-implement it with Hamlit::Filters::Base
.
I think we should create Hamlit::Filters::Opal
in opal-rails/lib/opal/rails/hamlit_filter.rb. Since Hamlit's backend is the same as Slim, it'll be similar to Slim::Embedded::OpalEngine
.
Ok - try it now. Thanks
Here is another re-implement solution
Did you see it? faster_path https://github.com/danielpclark/faster_path/blob/master/lib/faster_path/optional/monkeypatches.rb
Monkey-patching is basically a bad idea. It makes hard to find where the method is defined. In addition, monkey-patching implementation is fragile since it's separately maintained in spite of tight coupling. Thus I'm reluctant to replace Haml's constant or methods in Hamlit.
Because Hamlit's goal is to be a replacement of Haml and haml.gem itself does not contain the filter for Opal, I don't accept adding Opal filter to hamlit.gem. So closing this issue.
I suggest two ways to solve this issue.
Hamlit::Filters::Opal
to opal-railsCreating something like hamlit-opal or opal-hamlit
Here it is https://github.com/hamlit/hamlit-opal. It's available as hamlit-opal v0.0.1.beta1. It's just conceptual and never tested.
great
Hello again! There are some gem like gem 'opal-rails' which depend on HAML::Filters
worked only with
require: false
May you can tell me best solution how fix it.
Or how better rewrite Class and method for back compability?