Class: IOStub

Inherits:
String show all
Defined in:
lib/extensions/mspec/mspec/helpers/io.rb

Instance Method Summary collapse

Methods inherited from String

#alarm, #bg_black, #bg_blue, #bg_brown, #bg_cyan, #bg_gray, #bg_green, #bg_magenta, #bg_red, #black, #blue, #bold, #brown, #camel_case, #camelize, #capitalize_first, #center, #classify, #constantize, #cyan, #dasherize, #deconstantize, #demodulize, #empty?, #foreign_key, #gray, #green, #hard_wrap, #humanize, #index, #info, #inspect, #int?, #justify_string, #ljust, #magenta, #modulize, natcmp, #numeric?, #pluralize, #primary, #red, #reverse_color, #rjust, #safe_constantize, #singularize, #slice!, #success, #sum, #tableize, #titleize, #to_s, #underline, #underscore, #warning

Methods included from Crypt::StringXor

#^

Methods included from Crypt::Noise

#add_noise, #remove_noise

Methods included from Comparable

#<, #<=, #==, #>, #>=, #between?

Instance Method Details

#flushObject



18
19
20
# File 'lib/extensions/mspec/mspec/helpers/io.rb', line 18

def flush
  self
end


6
7
8
# File 'lib/extensions/mspec/mspec/helpers/io.rb', line 6

def print(*str)
  write(str.join + $\.to_s)
end

#printf(format, *args) ⇒ Object



14
15
16
# File 'lib/extensions/mspec/mspec/helpers/io.rb', line 14

def printf(format, *args)
  self << sprintf(format, *args)
end

#puts(*str) ⇒ Object



10
11
12
# File 'lib/extensions/mspec/mspec/helpers/io.rb', line 10

def puts(*str)
  write(str.collect { |s| s.to_s.chomp }.concat([nil]).join("\n"))
end

#write(*str) ⇒ Object



2
3
4
# File 'lib/extensions/mspec/mspec/helpers/io.rb', line 2

def write(*str)
  self << str.join
end