Closed veganstraightedge closed 2 years ago
hi, i've not used slim before, but as long as the gem has a way to return ruby code rather than just rendered text, it should be doable.
if you'd like to make a PR, you'll need something equivalent to this file for haml: https://github.com/robotdana/leftovers/blob/main/lib/leftovers/haml.rb use that ::Leftovers::SLIM.precompile method here: https://github.com/robotdana/leftovers/blob/main/lib/leftovers/file.rb plus tweaks to add slim_paths to the config in https://github.com/robotdana/leftovers/blob/main/lib/leftovers/config.rb and https://github.com/robotdana/leftovers/blob/main/lib/leftovers/merged_config.rb
otherwise i'll get to it when i get to it
Thank you! We'll look into creating a PR. 🎉
Hi Dana. I'm starting to work on a PR for adding SLIM support. But before making any changes, I'm having a slew of tests fail. I was wondering if you are seeing these failures locally too?
ruby -v ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x86_64-darwin21]
macoS 12.1 (21C52)
My steps:
bin/setup
bundle exec rake spec
[snip]
Finished in 6.23 seconds (files took 0.46145 seconds to load)
359 examples, 124 failures
It looks like they're all the same Failure/Error:
1) rspec gem with method calls using be_
Failure/Error: require requirable
NameError:
uninitialized constant ActiveSupport::XmlMini::IsolatedExecutionState
# ./lib/leftovers.rb:150:in `require'
# ./lib/leftovers.rb:150:in `block in try_require_cache'
# ./lib/leftovers.rb:148:in `fetch'
# ./lib/leftovers.rb:148:in `try_require_cache'
# ./lib/leftovers.rb:129:in `try_require'
# ./lib/leftovers/merged_config.rb:28:in `block in <<'
# ./lib/leftovers/merged_config.rb:27:in `each'
# ./lib/leftovers/merged_config.rb:27:in `<<'
# ./lib/leftovers/merged_config.rb:100:in `block in load_bundled_gem_config'
# ./lib/leftovers/merged_config.rb:99:in `each'
# ./lib/leftovers/merged_config.rb:99:in `load_bundled_gem_config'
# ./lib/leftovers/merged_config.rb:16:in `initialize'
# ./lib/leftovers.rb:47:in `new'
# ./lib/leftovers.rb:47:in `config'
# ./spec/config/rspec_spec.rb:14:in `block (2 levels) in <top (required)>'
ah looks like it's incompatible with activesupport 7 i'll see if i can fix it
in the mean time, if you pin active support below 7. change leftovers.gemspec
spec.add_development_dependency 'activesupport'
to
spec.add_development_dependency 'activesupport', '< 7'
then run bundle update
Ah gotcha. Thanks!
i think i've fixed this issue with #12, which is now published as v0.5.3
Thanks! (Also, you were right that pinning to < 7
worked as (brief!) temporary workaround.))
thanks for doing this in #13
Thanks for making this gem! 🎉
I'm trying to get into our team's repo, but we use
.slim
templates.Is there a way to configure
leftovers
to also analyze our SLIM views?