class RBT::CopyTheseArchives
Public Class Methods
[](i = ARGV)
click to toggle source
new( commandline_arguments = nil, run_already = true )
click to toggle source
Public Instance Methods
copy_this_archive(i)
click to toggle source
reset()
click to toggle source
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/copy_these_archives.rb, line 53 def run commandline_arguments?.each {|this_target| full_target_path = this_target.dup if RBT.respond_to? :swift_return_version_of_this_program version_of_the_program = return_version_of_this_program(this_target) else require 'rbt/requires/require_the_cookbook_class.rb' version_of_the_program = RBT::Cookbooks::SanitizeCookbook.new(this_target) { :fast }.program_version? end unless this_target.include? '/' unless File.file?(this_target) full_target_path = src_dir?+this_target end end # ===================================================================== # # this_target may now look like this: # # /home/x/src/linux # # We will next have to obtain the most recent version of the program. # ===================================================================== # unless full_target_path.end_with? '/' full_target_path << '/' end # ===================================================================== # # Now we can attempt to find a locally existing file. We will grab the # first entry found, if the result is not empty. # ===================================================================== # use_this_target = full_target_path+this_target+'-'+version_of_the_program+'*' possible_files = Dir[use_this_target] unless possible_files.empty? copy_this_archive(possible_files.first) end } end