Sha256: 5313f676fa0fad2ae02c6d57af1269016263612ee28516d724d032b79030f18b
Contents?: true
Size: 313 Bytes
Versions: 20
Compression:
Stored size: 313 Bytes
Contents
# A parallel WordCount. Depends on the 'wc' utility. class WordCount < CloudCrowd::Action # Count the words in a single book. def process (`wc -w #{input_path}`).match(/\A\s*(\d+)/)[1].to_i end # Sum the total word count. def merge input.inject(0) {|sum, count| sum + count } end end
Version data entries
20 entries across 20 versions & 2 rubygems