Sha256: 547dc56e735362491b93df3329bc4ed782a50fc75f9b35dcab28656088048b2f
Contents?: true
Size: 633 Bytes
Versions: 3
Compression:
Stored size: 633 Bytes
Contents
#!/usr/bin/env ruby # Author:: Nicolas Pouillard <ertai@lrde.epita.fr>. # Copyright:: Copyright (c) 2005 Uttk team. All rights reserved. # License:: LGPL # $Id: /w/fey/uttk/trunk/misc/expandtab.rb 8784 2005-09-26T12:11:55.049358Z ertai $ class String def process! chomp! gsub!(/\t/, ' ') self end end if ARGV.empty? STDIN.each do |line| puts line.process! end else ARGV.each do |file| puts "Processing: #{file}..." File.open("#{file}.tmp", 'w') do |tmp| IO.foreach(file) do |line| tmp.puts line.process! end end File.rename("#{file}.tmp", file) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
uttk-0.4.5.0 | misc/expandtab.rb |
uttk-0.4.6.1 | misc/expandtab.rb |
uttk-0.4.6.2 | misc/expandtab.rb |