Files
atom/bundles/ruby.tmbundle/Support/bin/make_destructive.rb
Corey Johnson & Nathan Sobo f84f9c5dd2 Add bundles and themes
2012-08-27 13:20:22 -07:00

19 lines
416 B
Ruby

#!/usr/bin/env ruby
require "escape"
CURSOR = [0xFFFC].pack("U").freeze
line = STDIN.read
begin
line[ENV["TM_LINE_INDEX"].to_i, 0] = CURSOR
rescue
exit
end
line.sub!(/\b(chomp|chop|collect|compact|delete|downcase|exit|flatten|gsub|lstrip|map|next|reject|reverse|rstrip|slice|sort|squeeze|strip|sub|succs|swapcase|tr|tr_s|uniq|upcase)\b(?!\!)/, "\\1!")
line = e_sn(line)
line.sub!(CURSOR, "$0")
print line