Sha256: f1bd53a9e482d15f101940768ab8692893f436f04198f1a5e7530600e8b80cd1

Contents?: true

Size: 458 Bytes

Versions: 1

Compression:

Stored size: 458 Bytes

Contents

Kernel.module_eval do
  
  define_method :putz do |obj|
    filename, line = caller[0].split(":")
    line_number = line.to_i - 1
    file = File.open(filename)
    line_contents = file.readlines[line_number]
    file.close
    clone = File.open(filename).readlines
    file = File.open(filename, "w")
    clone.each_with_index do |line, index|
      file.puts line unless index == line_number
    end
    file.flush
    file.close
    puts obj
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
putz-0.1.0 lib/putz.rb