
Mash conflicting with ExtLib
Reported by Baby Diego | April 14th, 2009 @ 08:05 PM
Trying out retweet (http://github.com/zapnap/retweet/tree/master),
when you run rake twitter:status
to fetch the results,
it throws a "stack level too deep" error.
Examining the issue with retweet's author and others, it was noticed that Mash is conflicting with ExtLib's own notion of a Mash class, which means that this breaks compatibility with anything that uses Extlib, as datamapper does – which was what was causing the problem in the app. As soon as a property is declared in Datamapper::Resource, the error is raised.
It seems to be a matter of namespace. Should I take this up to the ExtLib's team as well?
Comments and changes to this ticket
-
Nick Plante April 20th, 2009 @ 10:35 AM
+1 yup this is causing all sorts of problems for me (because the Twitter gem uses Mash and DataMapper uses Extlib). Namespaces to the rescue?
-
-
Mislav November 3rd, 2009 @ 03:37 PM
Since this Mash is better than extlib's, I've done the following to undef the latter's Mash before requiring twitter gem:
Object.send(:remove_const, :Mash) if defined? ::Mash require 'twitter' # fix for Mash v0.0.3 Mash.class_eval do def stringify_keys() self end end
Seems to me that dm-core doesn't notice the difference.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Mash is an extension of the Ruby Hash object to allow for pseudo-object syntax reminiscent of Javascript objects. It is useful for simple conversion of JSON or XML and also for configuration settings read from YAML.