Class: Hipe::GitHelper::BufferString

Inherits:
String
  • Object
show all
Defined in:
lib/hipe-githelper.rb

Overview

there was StringIO but i couldn’t figure out how to use it

Instance Method Summary collapse

Instance Method Details

#puts(mixed) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/hipe-githelper.rb', line 42

def puts mixed
  if mixed.kind_of? Array
    mixed.each{|x| puts x}
  else
    self << mixed
    self << "\n" if (mixed.kind_of? String and mixed.length > 0 and mixed[mixed.size-1] != "\n"[0])
  end
end

#readObject



37
38
39
40
41
# File 'lib/hipe-githelper.rb', line 37

def read
  output = self.dup
  self.replace('')
  output
end