Sha256: 794156d33a71a5c5d42f27d8b62ac39fe1d4ddd0d4b38314a6027aeb489c4eb2

Contents?: true

Size: 581 Bytes

Versions: 2

Compression:

Stored size: 581 Bytes

Contents

#!/usr/bin/env ruby

require 'optparse'
require 'dimsum'

include Dimsum

options = {}

OptionParser.new do |opts|
  opts.banner = "Usage: sample.rb [options]"
  opts.on("-n [Fixnum]", "--number [Fixnum]", "") do |n|
    options[:lines] = n
  end
end.parse!

options[:lines] ||= "5"

lines = options[:lines].to_i

reservoir_sample = if ARGV.length > 0
                     filename = ARGV[0]
                     reservoir_file(filename, lines)
                   else
                     reservoir_stdin(lines)
                   end

reservoir_sample.each{ |l| STDOUT.print l }

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dimsum-0.0.4 bin/dimsum
dimsum-0.0.3 bin/dimsum