repo.or.cz
/
ruby-mogilefs-client.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
rename "Put" namespace to "NewFile"
[ruby-mogilefs-client.git]
/
lib
/
mogilefs
/
new_file
/
writer.rb
blob
994545bc9c49c5dddc423c27129aaae4b630a1b8
1
# -*- encoding: binary -*-
2
# here are internal implementation details, do not use them in your code
3
#
4
module MogileFS::NewFile::Writer
5
def puts(*args)
6
args.each do |obj|
7
write(obj)
8
write("\n")
9
end
10
nil
11
end
12
13
def putc(ch)
14
write(ch.respond_to?(:chr) ? ch.chr : ch[0])
15
ch
16
end
17
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
28
29
def printf(*args)
30
write(sprintf(*args))
31
nil
32
end
33
34
def <<(str)
35
write(str)
36
self
37
end
38
39
def close
40
commit
41
nil
42
end
43
end