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

Lazily load time, cgi, and zlib #4010

Merged
merged 3 commits into from Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/rubygems/indexer.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
require 'rubygems'
require 'rubygems/package'
require 'time'
require 'tmpdir'

##
Expand Down
3 changes: 2 additions & 1 deletion lib/rubygems/package.rb
Expand Up @@ -44,7 +44,6 @@
require "rubygems"
require 'rubygems/security'
require 'rubygems/user_interaction'
require 'zlib'

class Gem::Package
include Gem::UserInteraction
Expand Down Expand Up @@ -186,6 +185,8 @@ def self.raw_spec(path, security_policy = nil)
# Creates a new package that will read or write to the file +gem+.

def initialize(gem, security_policy) # :notnew:
require 'zlib'

@gem = gem

@build_time = Gem.source_date_epoch
Expand Down
1 change: 0 additions & 1 deletion lib/rubygems/remote_fetcher.rb
Expand Up @@ -78,7 +78,6 @@ def self.fetcher
def initialize(proxy=nil, dns=nil, headers={})
require 'net/http'
require 'stringio'
require 'time'
require 'uri'

Socket.do_not_reverse_lookup = true
Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/request.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
require 'net/http'
require 'time'
require 'rubygems/user_interaction'

class Gem::Request
Expand Down Expand Up @@ -144,6 +143,7 @@ def fetch
request.add_field 'Keep-Alive', '30'

if @last_modified
require 'time'
request.add_field 'If-Modified-Since', @last_modified.httpdate
end

Expand Down
3 changes: 2 additions & 1 deletion lib/rubygems/uri_formatter.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
require 'cgi'

##
# The UriFormatter handles URIs from user-input and escaping.
Expand All @@ -18,6 +17,8 @@ class Gem::UriFormatter
# Creates a new URI formatter for +uri+.

def initialize(uri)
require 'cgi'

@uri = uri
end

Expand Down
1 change: 0 additions & 1 deletion util/create_certs.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
require 'openssl'
require 'time'

class CertificateBuilder
attr_reader :start
Expand Down