Sha256: 5d1261b298abfdf128e66b74c3f39eb99b39e3c43f6ad601b315fa948afce125

Contents?: true

Size: 764 Bytes

Versions: 2

Compression:

Stored size: 764 Bytes

Contents

#!/usr/bin/env ruby

require "postdata"
require 'optparse'
require 'logger'

class Logger
  class Formatter
    def call(severity, time, progname, msg)
      format = "[%s] %s %s\n"
      format % ["#{time.strftime('%Y-%m-%d %H:%M:%S')}", severity, msg2str(msg)]
    end
  end
end
logger = Logger.new(STDOUT)
logger.formatter = Logger::Formatter.new
logger.level = Logger::INFO


opt = OptionParser.new
opt.banner = "Usage: #{opt.program_name} [-h|--help] <args>"
opt.separator("Available Options")
opt.version = Postdata::VERSION
opts = {}
opt.on('-f', 'force download') {|v| opts[:f] = v }
opt.on('-d DIRECTORY', 'download directory') {|v| opts[:d] = v }
opt.on('-v') {|v| puts Postdata::VERSION}
opt.parse!(ARGV)


Postdata::download(opts[:d], opts[:f], logger)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
postdata-0.2.0 exe/postdata
postdata-0.1.0 exe/postdata