Rubygems causes a warning on 1.9.3

aaron.patterson's Avatar

aaron.patterson

15 Nov, 2010 10:15 PM

I'm getting warnings in rubygems. The warning is this:

rubygems/gem_openssl.rb:45: warning: possibly useless use of :: in void context

Here is the patch I used to fix, but maybe a different patch would be better:

diff --git a/lib/rubygems/gem_openssl.rb b/lib/rubygems/gem_openssl.rb
index ade9564..029094d 100644
--- a/lib/rubygems/gem_openssl.rb
+++ b/lib/rubygems/gem_openssl.rb
@@ -42,7 +42,7 @@ begin
   # Reference a constant defined in the .rb portion of ssl (just to
   # make sure that part is loaded too).

-  OpenSSL::Digest::SHA1
+  _ = OpenSSL::Digest::SHA1

   Gem.ssl_available = true
  1. Support Staff 1 Posted by Nick Quaranto on 16 Nov, 2010 03:24 AM

    Nick Quaranto's Avatar

    Added John to this discussion.

  2. 2 Posted by mtodd on 16 Nov, 2010 05:36 AM

    mtodd's Avatar

    Maybe:

    Gem.ssl_available = !!OpenSSL::Digest::SHA1

    At the risk of being "too clever" (aka, dumb).

  3. Support Staff 3 Posted by John Barnette on 17 Nov, 2010 07:25 AM

    John Barnette's Avatar

    I'm on it.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

23 Oct, 2014 05:37 PM
21 Oct, 2014 10:47 AM
18 Oct, 2014 08:39 PM
16 Oct, 2014 12:41 PM
06 Oct, 2014 02:30 PM