Do not call .setup
on Singleton when loading the main lib
#51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @kernow,
First, thank you very much for this incredible library. It helped me a lot setting up configurable templates for my CMS 馃帀
This PR aims to fix the following issue: after I installed Shortcode latest version, I kept reading on my logs the
[DEPRECATION] singleton Shortcode.setup
warning, which was not true in my case. I barely installed the gem, how I was calling theShortcode.setup
method? 馃. I didn't know where this was coming, until I checked out the library code.Based on latest master, I noticed that the
Shortcode.setup
delegates its call to the.singleton
method, which initializes a new instance of theShortcode
object. This will trigger the library default configuration, callingShortcode.setup
or not.This behavior also makes the
Shortcode.setup {}
call at the end of thelib/shortcode.rb
file unnecessary (shortcode/lib/shortcode.rb
Line 68 in 8f539c8
Also tested it locally running
appraisal rspec
, and all tests are green 馃槃