lib/nito.rb in getch-0.3.4 vs lib/nito.rb in getch-0.3.5
- old
+ new
@@ -53,24 +53,24 @@
res
end
# Like echo 'content' > to_file
def echo(file, content)
- File.write file, "#{content}\n", mode: 'w'
+ File.write(file, "#{content}\n")
end
# Like echo 'content' >> to_file
def echo_a(file, content)
- File.write file, "#{content}\n", mode: 'a' unless grep? file, content
+ File.write(file, "#{content}\n", mode: 'a') unless grep? file, content
end
def cp(src, dest)
FileUtils.cp src, dest
end
# create a void file
def touch(file)
- File.write file, '' unless File.exist? file
+ File.write(file, '') unless File.exist? file
end
# Like sed -i /old:new/ file
def sed(file, regex, change)
tmp_file = Tempfile.new