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

Remove activesupport dependency #66

Closed
project-eutopia opened this issue Jan 16, 2018 · 5 comments
Closed

Remove activesupport dependency #66

project-eutopia opened this issue Jan 16, 2018 · 5 comments

Comments

@project-eutopia
Copy link
Owner

Required changes:

  • Implement Array.split
  • Implement Array.wrap
  • Implement Object.present? and Object.blank?
  • Implement String.underscore
  • Change try to safe navigation operator &.
@shioyama
Copy link
Contributor

Rather than monkey-matching core classes, I'd recommend creating a separate class which has all the methods and calling them explicitly, like this.

@project-eutopia
Copy link
Owner Author

@shioyama Thanks for the helpful comment. I agree with your suggestion 👍

I knew some of the above methods were ActiveSupport features, but some I was surprised about. In particular I wish Array.split was a native Ruby method, as it fits nicely along with String.split.

@shioyama
Copy link
Contributor

I learned that you can get the same result as Array.wrap(...) by just calling Array(...). Array is actually a method on Kernel. Neat eh?

@project-eutopia
Copy link
Owner Author

That is neat, and it would work here. Reading up it seems that the notation [*to_be_wrapped] is equivalent to Array(to_be_wrapped), but I would prefer using Array.

@project-eutopia
Copy link
Owner Author

@shioyama Thanks for your helpful advice. I removed the dependency in #78

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

No branches or pull requests

2 participants