b0VIM 7.2w9K>Udimuswork-macpro.local~dimus/code/dwc_archive/lib/dwc-archive/expander.rbutf-8 3210#"! UtpGadb Gx6|{m5-, } A :  w m l L e ] V A 1 T  end end end res end end end end break res = check_path if path_entries(check_path).include?('meta.xml') if FileTest.directory?(check_path) check_path = File.join(@path, e) entries.each do |e| else res = @path if entries.include?('meta.xml') entries = path_entries(@path) res = nil def files_path end Dir.entries(dir).select {|e| e !~ /[\.]{1,2}$/}.sort def path_entries(dir) end return nil end return proc { |tmp_path, archive_path| system "unzip -qq -d #{tmp_path} #{archive_path}" } if file_type.match(/Zip/) end end system "tar -zxvf #{archive_path} -C #{tmp_path}" FileUtils.mkdir tmp_path return proc do |tmp_path, archive_path| if file_type.match(/tar.*gzip/i) file_type = IO.popen("file -z " + @archive_path).read def get_unpacker private end Dir.entries(path).select {|e| e !~ /[\.]{1,2}$/}.sort return nil unless path && FileTest.exists?(path) def files end FileUtils.rm_rf(@path) if FileTest.exists?(@path) def clean end @files_path ||= files_path def path end @unpacker.call(@path, @archive_path) if @unpacker clean def unpack end @unpacker = get_unpacker @path = File.join(tmp_dir, 'dwc_' + rand(10000000000).to_s) @tmp_dir = tmp_dir @archive_path = archive_path def initialize(archive_path, tmp_dir) class Expanderclass DarwinCore