class RBT::FindAlternativeArchive
Constants
- DEFAULT_ARGUMENT
#¶ ↑
DEFAULT_ARGUMENT
¶ ↑#¶ ↑
- NAMESPACE
#¶ ↑
NAMESPACE
¶ ↑#¶ ↑
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 44 def initialize( commandline_arguments = DEFAULT_ARGUMENT, run_already = true ) reset set_commandline_arguments( commandline_arguments ) 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 76 def archive_type? # Return the archive type here. return DetermineArchiveType[path?] end
Also aliased as: archive_type
commandline_arguments?()
click to toggle source
#¶ ↑
commandline_arguments?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/find_alternative_archive.rb, line 162 def commandline_arguments? @commandline_arguments end
Also aliased as: input?
determine_directory_name()
click to toggle source
determine_file_path()
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 152 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 169 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 139 def return_alternative_archives return_default_files.select {|entry| is_an_archive? entry } end
Also aliased as: check_for_other_archive_types
return_default_files(from = "
click to toggle source
run()
click to toggle source
set_commandline_arguments(i = '')
click to toggle source