Sha256: 66c75ffdd71060e51f8e79f45cc8f6aef9b4fa629fd5428b8b21b958aa33c08d

Contents?: true

Size: 590 Bytes

Versions: 11

Compression:

Stored size: 590 Bytes

Contents

require 'rbkb/cli'

# Copyright 2009 emonti at matasano.com 
# See README.rdoc for license information
#
# d64 converts a base-64 encoded string back to its orginal form.
class Rbkb::Cli::D64 < Rbkb::Cli::Executable
  def make_parser
    super()
    @oparse.banner += " <data | blank for stdin>"
    add_std_file_opt(:indat)
  end

  def parse(*args)
    super(*args)
    parse_string_argument(:indat)
    parse_file_argument(:indat)
    parse_catchall()
    @opts[:indat] ||= @stdin.read
  end

  def go(*args)
    super(*args)
    @stdout << @opts[:indat].d64
    self.exit(0)
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
emonti-rbkb-0.6.6 lib/rbkb/cli/d64.rb
emonti-rbkb-0.6.7 lib/rbkb/cli/d64.rb
emonti-rbkb-0.6.8 lib/rbkb/cli/d64.rb
emonti-rbkb-0.6.9.1 lib/rbkb/cli/d64.rb
emonti-rbkb-0.6.9 lib/rbkb/cli/d64.rb
rbkb-0.7.2 lib/rbkb/cli/d64.rb
rbkb-0.7.1 lib/rbkb/cli/d64.rb
rbkb-0.7.0 lib/rbkb/cli/d64.rb
rbkb-0.6.12 lib/rbkb/cli/d64.rb
rbkb-0.6.11 lib/rbkb/cli/d64.rb
rbkb-0.6.10 lib/rbkb/cli/d64.rb