Sha256: c946dd11d230eb2d907f23dbc2987d72a5118604ef6f2cd767a29e6adb34ea56
Contents?: true
Size: 566 Bytes
Versions: 7
Compression:
Stored size: 566 Bytes
Contents
module Approvals class Dotfile class << self def reset File.delete(path) if File.exists?(path) touch end def path '.approvals' end def touch FileUtils.touch(path) end def append(text) unless includes?(text) write text end end def includes?(text) system("cat #{path} | grep -q \"^#{text}$\"") end def write(text) File.open(path, 'a+') do |f| f.write "#{text}\n" end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems