Sha256: 48eb437da2f614f22a04abe083338c407b62e42ba33073f7910c41140b1c7c14
Contents?: true
Size: 760 Bytes
Versions: 17
Compression:
Stored size: 760 Bytes
Contents
module LessonsIndexer module Addons module FileManager class Writer attr_reader :name def initialize(name) @name = name end def prepend_data(data) begin old_data = File.read(name) rescue StandardError => e warning `ls` warning e.message end unless old_data.start_with?(data) new_data = old_data.prepend(data) self << new_data end end def <<(*args) begin File.open(name, 'w+') { |f| f.write(args.join) } rescue StandardError => e warning e.message end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems