Sha256: a2fc47c6cb578228b647af2b8c73f5709d2690ed5b0f27d8da27eb4df9dd76de
Contents?: true
Size: 666 Bytes
Versions: 1
Compression:
Stored size: 666 Bytes
Contents
require 'rbkb/cli' # Copyright 2009 emonti at matasano.com # See README.rdoc for license information # # b64 converts strings or raw data to base-64 encoding. class Rbkb::Cli::B64 < Rbkb::Cli::Executable def make_parser super() arg = @oparse arg.banner += " <data | blank for stdin>" arg.on("-l", "--length LEN", Numeric, "Output LEN chars per line") do |l| bail("length must be > 0") unless l > 0 @opts[:len] = l end end def parse(*args) super(*args) parse_string_argument(:indat) parse_catchall() end def go(*args) super(*args) @stdout << @opts[:indat].b64(opts[:len]).chomp + "\n" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
emonti-rbkb-0.6.2.1 | lib/rbkb/cli/b64.rb |