Sha256: 08e8c13786af5f24ff6ae918d87cbf86e57a3da45f1c3049065f964ab27f3bd2
Contents?: true
Size: 547 Bytes
Versions: 1
Compression:
Stored size: 547 Bytes
Contents
require 'fileutils' namespace :url do desc "Normalize album names name for URL format" task :sluglify, :source do |t, args| albums = Picturama::albums(args[:source]) puts "In folder #{args[:source].inspect} I'm moving..." albums.each do |album| target_folder = "#{args[:source]}/#{album.folder.to_url}" unless File.directory?(target_folder) FileUtils.mv "#{args[:source]}/#{album.folder}", "#{target_folder}" puts "#{album.folder.inspect} to #{album.folder.to_url.inspect}" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
picturama-0.0.6 | lib/tasks/url.rake |