lib/rye/rap.rb in rye-0.7.3 vs lib/rye/rap.rb in rye-0.7.4

- old
+ new

@@ -92,21 +92,40 @@ return self.first if self.size == 1 return "" if self.size == 0 self end + # Output STDOUT content to (remote) +path+ + # This works like a shell redirect so the file contents are + # cleared before outputting. + # + # rbox.ps('aux') > 'processes.log' + # + def >(path) + self.obj.unsafely { rm path } + self.obj.file_append(path, self) + end + + # Output STDOUT content to (remote) +path+ + # This works like a shell redirect so if the target file + # exists the STDOUT content will be appended. + # + # rbox.ps('aux') >> 'processes.log' + # + def >>(path) + self.obj.file_append(path, self) + end + + + # NOTE: This is broken! #def grep *args # self.select do |boxrap| # b = boxrap.grep(*args) # b.empty? ? false : b # end #end - - #def >>(*other) - # p other - #end #--- # If Box's shell methods return Rap objects, then # we can do stuff like this # rbox.cp '/etc' | rbox2['/tmp'] \ No newline at end of file