#!/usr/bin/env ruby require "pathname" root = Pathname.new(__FILE__).realpath.parent.parent $:.unshift root.join("lib") if $0 == __FILE__ require "mechanize" require "oddb2xml" require "oddb2xml/options" $stdout.sync = true opts = Oddb2xml::Options.parse(ARGV) args = ARGV if args.size > 0 puts "Please remove unused parameters #{args}" exit 2 end # TEMP if (path = args.first) opts[:transfer_dat] = path end start_time = Time.now ui = Oddb2xml::Cli.new(opts) begin if opts[:format] == :xml opts[:ean14] = true # force end # puts opts if opts[:debug] if RUBY_VERSION.to_f < 1.9 message = <<~MES Once you find some time, please upgrade your Ruby to 1.9.3 ;) then you will not see anymore warnings MES warn message end ui.run rescue Interrupt exit end diff = (Time.now - start_time).to_i puts "#{Time.now}: #{__LINE__} done. Took #{diff} seconds" $stdout.sync