deploy/scripts/setup_creator.rb
# name_to_cut: path to be cut in the result beacuse we need a releative filename list
path to be cut in the result beacuse we need a releative filename list
path to be cut in the result beacuse we need a releative filename list
def list_of_app_deployed_files(root_dir, name_to_cut)
    fscd = FileScanDir.new
    fscd.is_silent = true
    fscd.scan_dir(root_dir)
    res_names = []
    old_rel_dir_path = nil
    fscd.result_list.each do |file_src|
      name =  file_src.gsub(name_to_cut, "")
      rel_dir_path = File.dirname(name) 
      name.gsub!('/', "\\")
      puts str_path_file = "#{name}"
      if rel_dir_path != old_rel_dir_path
        puts "Path changed to: #{rel_dir_path}"
        adptrel_dir_path = "\\#{rel_dir_path.gsub('/', "\\")}" 
        res_names << { :filename => str_path_file, :out_path => adptrel_dir_path, 
                       :delete_path => old_rel_dir_path  }
        old_rel_dir_path = rel_dir_path
      else
        res_names << { :filename => str_path_file }
      end
    end
    p res_names.last[:delete_path] = old_rel_dir_path
    return res_names
  end
def list_of_app_deployed_files ( root_dir , name_to_cut ) fscd = FileScanDir . new fscd . is_silent = true fscd . scan_dir ( root_dir ) res_names = [ ] old_rel_dir_path = nil fscd . result_list . each do | file_src | name = file_src . gsub ( name_to_cut , "" ) rel_dir_path = File . dirname ( name ) name . gsub! ( '/' , "\\" ) puts str_path_file = "#{name}" if rel_dir_path != old_rel_dir_path puts "Path changed to: #{rel_dir_path}" adptrel_dir_path = "\\#{rel_dir_path.gsub('/', "\\")}" res_names << { :filename => str_path_file , :out_path => adptrel_dir_path , :delete_path => old_rel_dir_path } old_rel_dir_path = rel_dir_path else res_names << { :filename => str_path_file } end end p res_names . last [ :delete_path ] = old_rel_dir_path return res_names end
name_to_cut: path to be cut in the result beacuse we need a releative filename list
name_to_cut : path to be cut in the result beacuse we need a releative filename list
#each file need to be specified like without keyword File: #   File "app\\src\\cuperativa_gui.rb" # note: not work with \ intead of / on the path # need: \app\src\network
root_dir
<not_specific>
name_to_cut
<not_specific>