Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add middleman 4.4 support #27

Merged
merged 2 commits into from
Sep 13, 2021

Conversation

koppen
Copy link
Contributor

@koppen koppen commented Sep 13, 2021

Without this site_data ends up returning nil on Middleman 4.4.

data from Middleman returns a Middleman::CoreExtensions::Data::DataStore, and data['site'] returns a Middleman::Util::EnhancedHash. That is all fine.

However, we then end up calling with_indifferent_access on the EnhancedHash, which hits EnhancedHash#method_missing because with_indifferent_access isn't defined. That method_missing call then
returns nil which is what site_data ends up returning, breaking all subsequent [] accesses.

I am guessing Middleman 4.4 stopped requiring "active_support/core_ext/hash/indifferent_access" and we've relied on that until now, although I haven't been able to verify that.

This fixes #25, #26 as far as I can tell.

Something around these parts are going to break with Middleman 4.4 -
let's see if we can pinpoint it.
Without this `site_data` ends up returning `nil` on Middleman 4.4.

`data` from Middleman returns a
`Middleman::CoreExtensions::Data::DataStore`, and `data['site']` returns
a `Middleman::Util::EnhancedHash`. That is all fine.

However, we then end up calling `with_indifferent_access` on the
`EnhancedHash`, which hits `EnhancedHash#method_missing` because
`with_indifferent_access` isn't defined. That `method_missing` call then
returns `nil` which is what `site_data` ends up returning, breaking all
subsequent `[]` accesses.
@tiste tiste merged commit 413554f into tiste:master Sep 13, 2021
@tiste
Copy link
Owner

tiste commented Sep 13, 2021

Thanks a lot @koppen!

@koppen koppen deleted the add_middleman_4.4_support branch June 6, 2023 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uninitialized constant ActiveSupport::HashWithIndifferentAccess
2 participants