Skip to content

Use ActiveSupport's constantize#120

Merged
chanks merged 2 commits intoque-rb:masterfrom
joevandyk:use_activesupport_constantize
Sep 4, 2015
Merged

Use ActiveSupport's constantize#120
chanks merged 2 commits intoque-rb:masterfrom
joevandyk:use_activesupport_constantize

Conversation

@joevandyk
Copy link
Copy Markdown
Contributor

Fixes #115

@joevandyk
Copy link
Copy Markdown
Contributor Author

I was not able to get any tests to show the bug. :/

@chanks
Copy link
Copy Markdown
Collaborator

chanks commented Sep 3, 2015

Hmm, that's disconcerting. I want to give it a shot myself before merging.

On Thu, Sep 3, 2015 at 12:50 PM, Joe Van Dyk notifications@github.com
wrote:

I was not able to get any tests to show the bug. :/


Reply to this email directly or view it on GitHub
#120 (comment).

@joevandyk
Copy link
Copy Markdown
Contributor Author

Another option is to use Sidekiq's version:
https://github.com/mperham/sidekiq/blob/2fc1d81cc9691c9232a088f1410c5a27fae5e11f/lib/sidekiq/core_ext.rb#L88-L103

Resque seems to copy over the implementation:
https://github.com/resque/resque/blob/master/lib/resque/core_ext/string.rb

I updated the commit with using String#constanize if it exists. I'm not sure what the best method is.

chanks added a commit that referenced this pull request Sep 4, 2015
@chanks chanks merged commit 03ffd0a into que-rb:master Sep 4, 2015
@chanks
Copy link
Copy Markdown
Collaborator

chanks commented Sep 4, 2015

Tried a bit to write a failing spec and couldn't, but oh well, it's not a bad idea anyways.

Will be releasing 0.11.0 in just a bit.

@joevandyk
Copy link
Copy Markdown
Contributor Author

I wasn't sure if you would want to use the methods that Sidekiq or Resque use. (It's too bad this isn't a standard Ruby method)

@chanks
Copy link
Copy Markdown
Collaborator

chanks commented Sep 4, 2015

I think keeping the current method if ActiveSupport isn't present is fine.
If someone not using ActiveSupport runs into it we can import one of those
methods later.

And I just realized I forgot to update the changelog with this fix before I
cut the new version, but I'll do it now.

On Fri, Sep 4, 2015 at 5:27 PM, Joe Van Dyk notifications@github.com
wrote:

I wasn't sure if you would want to use the methods that Sidekiq or Resque
use. (It's too bad this isn't a standard Ruby method)


Reply to this email directly or view it on GitHub
#120 (comment).

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.

2 participants