From: elijah Date: Tue, 28 Oct 2014 18:21:21 +0000 (-0700) Subject: autoload some of the external dependencies that are rarely used, so that we don't... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=dddbaa40ed9abb1031ccdce21c3d6769dbc5b112;p=leap%2Fleap_cli.git autoload some of the external dependencies that are rarely used, so that we don't need to load them every time. --- diff --git a/lib/leap_cli/commands/ca.rb b/lib/leap_cli/commands/ca.rb index ecc324b..579e305 100644 --- a/lib/leap_cli/commands/ca.rb +++ b/lib/leap_cli/commands/ca.rb @@ -1,6 +1,6 @@ -require 'openssl' -require 'certificate_authority' -require 'date' +autoload :OpenSSL, 'openssl' +autoload :CertificateAuthority, 'certificate_authority' +autoload :Date, 'date' require 'digest/md5' module LeapCli; module Commands diff --git a/lib/leap_cli/commands/node.rb b/lib/leap_cli/commands/node.rb index 304d86b..ba637f8 100644 --- a/lib/leap_cli/commands/node.rb +++ b/lib/leap_cli/commands/node.rb @@ -1,6 +1,4 @@ -require 'net/ssh/known_hosts' -require 'tempfile' -require 'ipaddr' +autoload :IPAddr, 'ipaddr' module LeapCli; module Commands diff --git a/lib/leap_cli/commands/user.rb b/lib/leap_cli/commands/user.rb index d7c21db..a1b4c43 100644 --- a/lib/leap_cli/commands/user.rb +++ b/lib/leap_cli/commands/user.rb @@ -1,4 +1,4 @@ -require 'gpgme' +autoload :GPGME, 'gpgme' # # perhaps we want to verify that the key files are actually the key files we expect. diff --git a/lib/leap_cli/commands/vagrant.rb b/lib/leap_cli/commands/vagrant.rb index 24310e2..6227ece 100644 --- a/lib/leap_cli/commands/vagrant.rb +++ b/lib/leap_cli/commands/vagrant.rb @@ -1,4 +1,4 @@ -require 'ipaddr' +autoload :IPAddr, 'ipaddr' require 'fileutils' module LeapCli; module Commands diff --git a/lib/leap_cli/remote/rsync_plugin.rb b/lib/leap_cli/remote/rsync_plugin.rb index 48f82d3..a6708f4 100644 --- a/lib/leap_cli/remote/rsync_plugin.rb +++ b/lib/leap_cli/remote/rsync_plugin.rb @@ -3,7 +3,7 @@ # (see RemoteCommand::new_capistrano) # -require 'rsync_command' +autoload :RsyncCommand, 'rsync_command' module LeapCli; module Remote; module RsyncPlugin diff --git a/lib/leap_cli/util/secret.rb b/lib/leap_cli/util/secret.rb index a6bd7a3..837a0af 100644 --- a/lib/leap_cli/util/secret.rb +++ b/lib/leap_cli/util/secret.rb @@ -4,7 +4,7 @@ # # Uses OpenSSL random number generator instead of Ruby's rand function # -require 'openssl' +autoload :OpenSSL, 'openssl' module LeapCli; module Util class Secret diff --git a/lib/leap_cli/util/x509.rb b/lib/leap_cli/util/x509.rb index 9ecd92d..787fdfa 100644 --- a/lib/leap_cli/util/x509.rb +++ b/lib/leap_cli/util/x509.rb @@ -1,5 +1,6 @@ -require 'openssl' -require 'certificate_authority' +autoload :OpenSSL, 'openssl' +autoload :CertificateAuthority, 'certificate_authority' + require 'digest' require 'digest/md5' require 'digest/sha1'