class RBT::FindAlternativeArchive
Constants
- DEFAULT_ARGUMENT
#¶ ↑
DEFAULT_ARGUMENT
¶ ↑#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
new( commandline_arguments = DEFAULT_ARGUMENT, run_already = true )
click to toggle source
#¶ ↑
initialize¶ ↑
The first argument should be the full, “expected” path to our archive in question. We need this full path so that this class can replace it with a proper new path, if necessary.
#¶ ↑
# File lib/rbt/utility_scripts/find_alternative_archive.rb, line 39 def initialize( commandline_arguments = DEFAULT_ARGUMENT, run_already = true ) reset set_commandline_arguments( commandline_arguments ) if commandline_arguments.empty? commandline_arguments? << DEFAULT_ARGUMENT end run if run_already end
Public Instance Methods
archive_type?()
click to toggle source
#¶ ↑
archive_type
?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/find_alternative_archive.rb, line 63 def archive_type? # Return the archive type here. return RBT.return_archive_type(path?) end
Also aliased as: archive_type
determine_directory_name()
click to toggle source
determine_file_path()
click to toggle source
directory_name?()
click to toggle source
file_path?()
click to toggle source
filename?()
click to toggle source
find_other_archive(i)
click to toggle source
#¶ ↑
find_other_archive
¶ ↑
The input to this method should be a version, as a number.
The method will then try to find other archives.
#¶ ↑
# File lib/rbt/utility_scripts/find_alternative_archive.rb, line 140 def find_other_archive(i) i = i.to_f unless i.is_a? Float _ = return_alternative_archives.select {|entry| entry =~ /#{i}/ } return _.first unless _.empty? nil # else we will return nil. end
has_alternative?()
click to toggle source
#¶ ↑
has_alternative?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/find_alternative_archive.rb, line 150 def has_alternative? return true unless return_alternative_archives.empty? end
Also aliased as: more_than_one_entry?
reset()
click to toggle source
return_alternative_archives()
click to toggle source
#¶ ↑
return_alternative_archives
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/find_alternative_archive.rb, line 157 def return_alternative_archives return_default_files.select {|entry| is_an_archive? entry }.sort.reverse end
Also aliased as: check_for_other_archive_types
return_default_files( from = "
click to toggle source
run()
click to toggle source