Method: String#>

Defined in:
lib/chitin/core_ext/string.rb

#>(other) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/chitin/core_ext/string.rb', line 52

def >(other)
  case other
  when Chitin::FileObject
    other.to_a.each do |fo|
      next if fo.directory?

      File.open(fo.to_s, 'w') {|f| f.puts self }
    end
  when String
    File.open(other, 'w') {|f| f.puts self }
  else
    raise "Unknown piping type: #{other.class}"
  end

  other
end