tests: speedup tests that require hitting mogstored
[ruby-mogilefs-client.git] / lib / mogilefs / new_file_writer.rb
blob9b90df46a93cb55581af0bb9103c489a4be86c1d
1 # -*- encoding: binary -*-
2 # here are internal implementation details, do not use them in your code
4 module MogileFS::NewFileWriter
5   def puts(*args)
6     args.each do |obj|
7       write(obj)
8       write("\n")
9     end
10     nil
11   end
13   def putc(ch)
14     write(ch.respond_to?(:chr) ? ch.chr : ch[0])
15     ch
16   end
18   def print(*args)
19     args = [ $_ ] unless args[0]
20     write(args.shift)
21     args.each do |obj|
22       write(obj)
23       write($,) if $,
24     end
25     write($\) if $\
26     nil
27   end
29   def printf(*args)
30     write(sprintf(*args))
31     nil
32   end
34   def <<(str)
35     write(str)
36     self
37   end
39   def close
40     commit
41     nil
42   end
43 end