livingstyleguide / livingstyleguide

Easily create front-end style guides with Markdown and Sass/SCSS.
https://livingstyleguide.org/
Other
871 stars 81 forks source link

Rails 5 deprecation warning (another one) #214

Closed bryszard closed 7 years ago

bryszard commented 7 years ago

Hello, we're using Rails 5 and lsg 2.0.1. We use lsg from few days and we get deprecation warnings when rendering views:

image

The only place in our gems when get_binding is called / defined (apart from ActiveRecord) is lsg:

image

Thanks for adjusting that in advance!

darrenterhune commented 7 years ago

Pretty sure this is fixed in Rails 5.1.0.beta https://github.com/rails/rails/commit/0189f4db6fe518de8909b66b7f30046bac52dedc

bryszard commented 7 years ago

Ok, @darrenterhune thanks for news.

bryszard commented 7 years ago

@darrenterhune There is a problem with calling parameterize in the #slug in /lib/livingstyleguide/markdown_extensions.rb, but changing it doesn't seem to solve the problem:

image

darrenterhune commented 7 years ago

@hagenburger is there a specific reason to require active supports string inflections here? Other than readability? Wondering if we could simply switch this out, which would have backwards compatibility and not raise deprecation warnings?

def slug(text)
  text.downcase.gsub(/[ _\.\-!\?\(\)\[\]]+/, "-").gsub(/^-|-$/, "")
end