Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Expand slim version support to latest (v3.0.1 at present). #602
That's true. The best you could do is in to add a post_install message to the gemspec like
if File.exist?('UPGRADING.md') gem.post_install_message = File.read('UPGRADING.md') end
and in the lib/brakeman.rb do something like:
# Slim 3.0.0 dropped support for Ruby if RUBY_VERSION < "1.9.0" gem "slim", ">=1.3.6", "<3.0" else gem "slim", ">=1.3.6" end require 'slim'
Why is the dependency so open-ended?
@presidentbeef I hear you. The difficulty is that we want to support 1.8.7 but they don't. I think I have a way to do that, but bundler doesn't honor it during tests.
We could also go with the optional dependency and the
And we're back. I think I like this solution. The project
Tested this on a Rails 4.2 app (Ruby 2.2.0) using slim 3.0.1 after installing it and upgrading my
At the time of this commit that's slim v3.0.1. That is, except for Ruby 1.8.7 installations. Slim dropped support[^0] for Ruby 1.8.7 in their 3.0.0 release. This commit allows Brakeman to move forward with slim support on all supported later Ruby versions. To do this accurately we must install an appropriate version of Slim by inspecting `RUBY_VERSION` at install time. We do that by using the native extensions hooks available as part of gem installs. Ours is modeled after an example on GitHub[^1]. [^0]: https://github.com/slim-template/slim/blob/master/CHANGES#L12 [^1]: https://github.com/mmzyk/gem_dependency_example/tree/master/gem_dep_example