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

Fix ruby 2.7 warning #246

Merged
merged 1 commit into from
Jan 10, 2020
Merged

Fix ruby 2.7 warning #246

merged 1 commit into from
Jan 10, 2020

Conversation

whois-marvin-42
Copy link
Contributor

@whois-marvin-42 whois-marvin-42 commented Dec 30, 2019

Fixed warning raised by latest ruby (FILE in eval) in base.rb

Fixes #221.

@AlexWayfer
Copy link

Ruby 2.7 is released, these warnings are annoying.

@deivid-rodriguez
Copy link
Owner

Right, I'll try to get a new version out today 👍.

@AlexWayfer
Copy link

Probably, we can take out common code with condition… into private method, for example. Or public class method, if it between different classes. Right now there is a duplication of logic.

@whois-marvin-42
Copy link
Contributor Author

CI showed problems for Ruby < 2.6 (missing source_location) ... rolled back to working proposal.

@AlexWayfer
Copy link

CI showed problems for Ruby < 2.6 (missing source_location) ... rolled back to working proposal.

Oh, it's Binding#source_location, introduced in Ruby 2.6, and I saw Method#source_location… sorry, my bad.

@whois-marvin-42
Copy link
Contributor Author

My bad too, I should have double-checked before making modifications.

@whois-marvin-42
Copy link
Contributor Author

Don't know what deivid-rodriguez had in mind ... just hoping it helps. AlexWayfer, thanks for your point of view.

@AlexWayfer
Copy link

AlexWayfer commented Jan 9, 2020

Don't know what deivid-rodriguez had in mind ... just hoping it helps. AlexWayfer, thanks for your point of view.

Everything is OK when CI passes. 👌

I just try to improve any code.

Thank you for contribution anyway.

@deivid-rodriguez deivid-rodriguez changed the title Fixes #221 Fix ruby 2.7 warning Jan 9, 2020
@deivid-rodriguez
Copy link
Owner

It's looking good to me. Could you rebase and add a changelog entry?

@AlexWayfer
Copy link

and add a changelog entry?

It'd be nice to add a note about this in CONTRIBUTING.md.

@whois-marvin-42
Copy link
Contributor Author

Done. Hope it's what you were expecting. Thanks for this tool btw.

@deivid-rodriguez deivid-rodriguez merged commit 6d4049e into deivid-rodriguez:master Jan 10, 2020
@deivid-rodriguez
Copy link
Owner

Thanks so much @whois-marvin-42!

@deivid-rodriguez
Copy link
Owner

It'd be nice to add a note about this in CONTRIBUTING.md.

Sure @AlexWayfer, can you open a PR?

@AlexWayfer
Copy link

It'd be nice to add a note about this in CONTRIBUTING.md.

Sure @AlexWayfer, can you open a PR?

Maybe, but it's your requirement, maybe you have others, so, I think, it's better to do you, as Owner (maintainer). For example, I prefer to update Changelog before releases.

@deivid-rodriguez
Copy link
Owner

Sure, I'll do it myself.

@deivid-rodriguez
Copy link
Owner

When I said, "I'll try to get a new version out today", that was way too optimistic 😅. I'll do it during next week though.

@MarcusRiemer
Copy link

Any chance for a version bump?

@deivid-rodriguez
Copy link
Owner

I'll be releasing 3.8.0 in a bit. One question though, is this warning 2.7.0 specific? Because I can't reproduce it on MRI 2.6.

@AlexWayfer
Copy link

AlexWayfer commented Jan 22, 2020

One question though, is this warning 2.7.0 specific?

Yep.

But, probably, in 2.6 too, with warnings flag: #221

From here: https://bugs.ruby-lang.org/issues/4352#note-23

The warning is printed only on the verbose mode in 2.6. It would be good to enable the warning by default in 2.7.

@deivid-rodriguez
Copy link
Owner

Thanks! I'll clarify this in the changelog!

@tisba
Copy link

tisba commented Apr 5, 2020

I'm not sure why, but I see this warning, when I updated to Ruby 2.7.1 using pry-byebug 3.9.0:

gems/pry-byebug-3.9.0/lib/pry-byebug/pry_ext.rb:13: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead

@deivid-rodriguez
Copy link
Owner

I'm not sure why. Can you show the full backtrace?

@tisba
Copy link

tisba commented Apr 6, 2020

Sure. What's the simplest way to get the full backtrace for warnings? 🤔

@tisba
Copy link

tisba commented Apr 6, 2020

Ah, I missed the next line. Looks like it caused by pry-stack_explorer gem:

/home/smith/vendor/bundle/ruby/2.7.0/gems/pry-byebug-3.9.0/lib/pry-byebug/pry_ext.rb:13: warning: __FILE__ in eval may not return location in binding; use Binding#source_location instead
/home/smith/vendor/bundle/ruby/2.7.0/gems/pry-stack_explorer-0.4.9.3/lib/pry-stack_explorer/when_started_hook.rb:63: warning: in `eval'

Do I read this correctly?

@deivid-rodriguez
Copy link
Owner

@tisba
Copy link

tisba commented Apr 7, 2020

duh, I believe there is already an issue for this pry/pry-stack_explorer#43

Sorry for the noise here :)

@deivid-rodriguez
Copy link
Owner

No problem!

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.

Ruby 2.6 warning (__FILE__ in eval)
5 participants