Sha256: 00a019cb371ef53edcb0d1698c982381e5bb8c0a2f1cc47dc24ae797c51300e6

Contents?: true

Size: 631 Bytes

Versions: 5

Compression:

Stored size: 631 Bytes

Contents

#! /usr/bin/env ruby

if ARGV.empty? || ARGV.first =~ /^-+(\?|h(elp)?)$/
  puts <<EOF
Usage: #{$0} dbp_file.dbp[.bz2]

Display contents of dbp file, optionally compressed with bz2.
EOF
  exit(0)
end

require 'wyrm/cli'
Wyrm.sanity_check_pbzip2

require 'pathname'
require 'yaml'

out_block = lambda do |io|
  record_count = 1
  until io.eof?
    puts "# record #{record_count}"
    puts Marshal.load(io).to_yaml
    record_count += 1
  end
end

ARGV.map{|a| Pathname(a)}.each do |path|
  puts "# source: #{path}"
  if path.extname == '.bz2'
    IO.popen "pbzip2 -d -c #{path}", &out_block
  else
    path.open &out_block
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wyrm-0.4.0 bin/wyrm-view
wyrm-0.3.3 bin/wyrm-view
wyrm-0.3.2 bin/wyrm-view
wyrm-0.3.1 bin/wyrm-view
wyrm-0.3.0 bin/wyrm-view