From 3c369a9bd5aa48558e8df2004bc90d590c48f4c7 Mon Sep 17 00:00:00 2001 From: Alex Dean Date: Wed, 4 Jan 2023 12:03:33 -0600 Subject: [PATCH] WIP: try to address warnings about constant redefinitions example: $ bundle exec rake test ... snip ... /Users/alexdean/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/protocol.rb:30: warning: method redefined; discarding old protocol_param /Users/alexdean/.rvm/gems/ruby-2.6.4/gems/net-protocol-0.2.1/lib/net/protocol.rb:32: warning: previous definition of protocol_param was here /Users/alexdean/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/protocol.rb:38: warning: method redefined; discarding old ssl_socket_connect /Users/alexdean/.rvm/gems/ruby-2.6.4/gems/net-protocol-0.2.1/lib/net/protocol.rb:40: warning: previous definition of ssl_socket_connect was here /Users/alexdean/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError /Users/alexdean/.rvm/gems/ruby-2.6.4/gems/net-protocol-0.2.1/lib/net/protocol.rb:68: warning: previous definition of ProtocRetryError was here /Users/alexdean/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/protocol.rb:79: warning: method redefined; discarding old initialize /Users/alexdean/.rvm/gems/ruby-2.6.4/gems/net-protocol-0.2.1/lib/net/protocol.rb:81: warning: previous definition of initialize was here /Users/alexdean/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/protocol.rb:82: warning: method redefined; discarding old io /Users/alexdean/.rvm/rubies/ruby-2.6.4/lib/ruby/2.6.0/net/protocol.rb:84: warning: method redefined; discarding old message changes made so far don't seem to resolve the error, so this might not be useful. unsure, but it seems like these might be due to bug in mail and/or rubygems. https://github.com/mikel/mail/pull/1439 --- lib/as2.rb | 2 -- lib/as2/client.rb | 2 ++ lib/as2/config.rb | 2 ++ lib/as2/server.rb | 4 +++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/as2.rb b/lib/as2.rb index 8d9c967..f7d55fb 100644 --- a/lib/as2.rb +++ b/lib/as2.rb @@ -1,5 +1,3 @@ -require 'openssl' -require 'mail' require 'securerandom' require 'as2/config' require 'as2/server' diff --git a/lib/as2/client.rb b/lib/as2/client.rb index 299c132..74d382b 100644 --- a/lib/as2/client.rb +++ b/lib/as2/client.rb @@ -1,4 +1,6 @@ +require 'mail' require 'net/http' +require 'openssl' module As2 class Client diff --git a/lib/as2/config.rb b/lib/as2/config.rb index d82733e..bf3e41d 100644 --- a/lib/as2/config.rb +++ b/lib/as2/config.rb @@ -1,4 +1,6 @@ +require 'openssl' require 'uri' + module As2 module Config def self.build_certificate(input) diff --git a/lib/as2/server.rb b/lib/as2/server.rb index 750fc6f..2320471 100644 --- a/lib/as2/server.rb +++ b/lib/as2/server.rb @@ -1,6 +1,8 @@ -require 'rack' require 'logger' +require 'openssl' +require 'rack' require 'stringio' + require 'as2/mime_generator' require 'as2/message'