Sha256: dcf010cda5262878bced00bf67db329cb0c030454958ff022ae1736fdd78a23e
Contents?: true
Size: 413 Bytes
Versions: 183
Compression:
Stored size: 413 Bytes
Contents
#!/usr/bin/env ruby require 'fileutils' include FileUtils::Verbose def usage STDERR.puts "Usage: #$0 prefix" end ARGV.empty? and usage prefix = ARGV.shift files = ARGV.sort_by do |x| if m = /(\d+)/.match(x) [ m.pre_match == prefix ? -1 : 0, m[1].to_i ] else [ -1, 0 ] end end for f in files mv f, f + '.tmp' end i = 1 for f in files mv f + '.tmp', sprintf("%s%03u", prefix, i) i += 1 end
Version data entries
183 entries across 183 versions & 1 rubygems