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.
Without this
site_data
ends up returningnil
on Middleman 4.4.data
from Middleman returns aMiddleman::CoreExtensions::Data::DataStore
, anddata['site']
returns aMiddleman::Util::EnhancedHash
. That is all fine.However, we then end up calling
with_indifferent_access
on theEnhancedHash
, which hitsEnhancedHash#method_missing
becausewith_indifferent_access
isn't defined. Thatmethod_missing
call then returnsnil
which is whatsite_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.