Cherry-pick Object#blank? extension #113

Merged
merged 1 commit into from Sep 5, 2012

2 participants

@jpignata

Since ActiveSupport is modular just include the #blank? inflection extension rather than including all of the core extensions and active_support itself.

It seems heavy-handed to require all of ActiveSupport's core extensions as a side effect of including an exception reporting API. According to 2ba25e8 this include was required for #blank? and #to_xml. I found references to the former but didn't find any to the latter. This pull does two things:

  • Localizes the required code to active_support/core_ext/object/blank
  • Removes the begin/rescue/end block around the require as if this is in fact a requirement a LoadError should be raised if its missing

My motivation for this change is a problem I'm having with using Airbrake in a jruby application that makes use of threads. Due to the way autoload works, I'm seeing threads blocking each other when dealing with JSON coercion with active_support required.

@jpignata jpignata Cherry-pick Object#blank? extension
Since ActiveSupport is modular just include the blank inflection extension
rather than including all of the core extensions and active_support itself.
60a84bd
@shime

Makes a lot of sense. Yeah, I've checked and we're not using #to_xml from ActiveSupport, we're defining our own.

Since we're really including ActiveSupport only to use #blank?, a better solution would be to get rid of that dependency.

@shime shime merged commit 60a84bd into airbrake:master Sep 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment