Sha256: 3767dbdc288377c8f183620754bdb8e12846bd15eac9a9862c2ee206758e3a45
Contents?: true
Size: 625 Bytes
Versions: 6
Compression:
Stored size: 625 Bytes
Contents
module PubliSci module Readers module Output def output(string, options={},append=false) options[:type] = [:string] unless options[:type] base = options[:file_base] name = options[:file_name] types = Array(options[:type]) if types.include? :print puts string end if types.include? :file raise "no file specified output" unless name method = append ? 'a' : 'w' open("#{base}#{name}", method) { |f| f.write str } end if types.include? :string string end end end end end
Version data entries
6 entries across 6 versions & 2 rubygems