Sha256: 2d88981b1a9c49e6ca272697882be986f0cf2f33e8629bbd2c25711fb5eb6086

Contents?: true

Size: 700 Bytes

Versions: 2

Compression:

Stored size: 700 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 in yaml, optionally compressed with bz2.
EOF
  exit(0)
end

require 'wyrm/cli'
Wyrm.sanity_check_dcmp

require 'pathname'
require 'yaml'
require 'sequel' # needed for demarshalling some types

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 "#{Wyrm::STREAM_DCMP} #{path}", &out_block
  else
    path.open &out_block
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wyrm-0.4.2 bin/wyrm-view
wyrm-0.4.1 bin/wyrm-view