Skip to content

Instantly share code, notes, and snippets.

@wagurano
Created August 29, 2015 05:50
Show Gist options
  • Save wagurano/0f06742ff0baf2a78b3f to your computer and use it in GitHub Desktop.
Save wagurano/0f06742ff0baf2a78b3f to your computer and use it in GitHub Desktop.
Move all of contents files to images directory
require 'FileUtils'
Dir["contents/**/*"].select{ |f| File.file? f }.map{ |f| FileUtils.move "#{f}", "images/#{File.basename f}.jpg" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment