From b6226ad3cb87eb4663bee49071d15bd2883460af Mon Sep 17 00:00:00 2001 From: Tristan Ancelet Date: Sat, 19 Oct 2024 11:20:47 -0500 Subject: [PATCH] Cleaned up portions --- install-discord-linux.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/install-discord-linux.rb b/install-discord-linux.rb index a433688..dda266d 100755 --- a/install-discord-linux.rb +++ b/install-discord-linux.rb @@ -5,13 +5,13 @@ require 'erb' require 'time' require 'json' -require 'net/http' -require 'English' -require 'rubygems/package' -require 'fileutils' -require 'optparse' require 'zlib' require 'find' +require 'English' +require 'net/http' +require 'optparse' +require 'fileutils' +require 'rubygems/package' # END: Includes & Requires @@ -23,7 +23,7 @@ require 'find' class Dir def / (path) - output_path = File.absolute_path(self.path) + '/' + path + output_path = File.join(self.path + '/' + path) if File.directory? output_path Dir.new(output_path) else @@ -34,7 +34,7 @@ end class String def / (other) - self + '/' + other + File.join(self, other) end end @@ -293,10 +293,10 @@ end # BEGIN: Work +installer = Installer.new case $CONFIG[:action] when 'install' - installer = Installer.new if installer.needs_update? puts "main: Installed Version will be updated" installer.download @@ -311,9 +311,9 @@ case $CONFIG[:action] puts puts " Report" puts "-------------------------------------" - puts " Remote Version: #{remote_version.to_s}" - puts " Local Version: #{local_version.to_s}" - puts " Needs Updating: #{(remote_version > local_version) ? "Yes" : "No"}" + puts " Remote Version: #{installer.remote_version.to_s}" + puts " Local Version: #{installer.local_version.to_s}" + puts " Needs Updating: #{installer.needs_update? ? "Yes" : "No"}" when 'backup' make_backup