title: Zipping a directory recursively & skip container directory
body: <p>Consider, we have following directory structure:</p>
  
  <pre><code>Location:
  /Users/me/Desktop/directory_to_zip/
  dir1 dir2 somefile.txt
  </code></pre>
  
  <p>now, If I use <a href="https://github.com/rubyzip/rubyzip" rel="noreferrer">rubyzip</a> to zip the contents of <code>directory_to_zip</code> using the following code:</p>
  
  <pre><code>directory = '/Users/me/Desktop/directory_to_zip/'
  zipfile_name = '/Users/me/Desktop/recursive_directory.zip'
  
  Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
      Dir[File.join(directory, '**', '**')].each do |file|
        zipfile.add(file.sub(directory, ''), file)
      end
  end
  </code></pre>
  
  <p>This will create a zip file named <code>recursive_directory.zip</code>, which will contain a container directory called <code>directory_to_zip</code> &amp; inside <code>directory_to_zip</code>, will I find my files(<code>dir1 dir2 somefile.txt</code>)</p>
  
  <p>HOw do I skip creation of <code>directory_to_zip</code> inside <code>recursive_directory.zip</code>, so that the zip file just contains the contents of <code>directory_to_zip</code> &amp; not the directory itself.</p>