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

Ruby Warnings #270

Merged
merged 3 commits into from Mar 1, 2018
Merged

Ruby Warnings #270

merged 3 commits into from Mar 1, 2018

Conversation

amatsuda
Copy link
Contributor

@amatsuda amatsuda commented Sep 1, 2017

Here are fixes for some Ruby-level warnings.
The first two "unused variable" warnings happen under Ruby 2.5 trunk, and the last one can be seen under all versions of Ruby.

LONG = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
it "should convert '#{LONG}' correctly" do
expect(Addressable::IDNA.to_unicode(LONG)).to eq(LONG)
long = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

LONG = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
it "should convert '#{LONG}' correctly" do
expect(Addressable::IDNA.to_ascii(LONG)).to eq(LONG)
long = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

LONG = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
it "should convert '#{LONG}' correctly" do
expect(Addressable::IDNA.to_unicode(LONG)).to eq(LONG)
long = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

LONG = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
it "should convert '#{LONG}' correctly" do
expect(Addressable::IDNA.to_ascii(LONG)).to eq(LONG)
long = 'AcinusFallumTrompetumNullunCreditumVisumEstAtCuadLongumEtCefallum.com'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@mattbrictson
Copy link

Now that Ruby 2.5.0 has been released, I am seeing this regularly:

lib/addressable/idna/pure.rb:154: warning: assigned but unused variable - startercc

Would be great to see this PR merged!

@AlexWayfer
Copy link

I've created the PR to @amatsuda fork for resolving comments by @houndci-bot.

else
unpacked_result << starter
starter = ch
startercc = cc
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. This was a straight port from C, so the original C probably had this unused variable too. Never noticed before. Cool.

@sporkmonger
Copy link
Owner

Re: Hound, we need to go through the codebase and just update the code style across the board. Lots of PRs are going to get flagged like this until we do.

@sporkmonger sporkmonger merged commit fba50b1 into sporkmonger:master Mar 1, 2018
@sporkmonger
Copy link
Owner

sporkmonger commented Mar 1, 2018

There's also the Kernel.BigDecimal deprecation warnings too in the tests. But at least those won't pop up for most people.

@twelvelabs
Copy link

@sporkmonger any chance there can be an official gem release that includes these changes? I've added a few gems that rely on addressable to a gem that I'm authoring, and I can't figure out a way to suppress these warnings w/out $VERBOSE hacks 😢.

@mtsmfm
Copy link

mtsmfm commented Sep 12, 2018

@sporkmonger Can I ask you to cut a new release?

@pvdb
Copy link

pvdb commented Nov 9, 2018

Echoing @twelvelabs and @mtsmfm - pretty please can we have a new gem release with these changes, @sporkmonger?

@rmm5t
Copy link

rmm5t commented Nov 27, 2018

@sporkmonger Friendly nudge. It would be great to see a new, officially versioned released published with this fix.

@sporkmonger
Copy link
Owner

Hey, I know it's been awhile. I'm sorry about that. I should probably just set a recurring "do maintenance on addressable" calendar reminder for myself. Cutting a release right now.

kamipo added a commit to rails/rails that referenced this pull request Apr 5, 2019
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.

None yet

9 participants