forked from zdavatz/oddb2xml
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made all spec-tests (except for builder) pass again
- Loading branch information
Showing
12 changed files
with
138 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,54 @@ | ||
#!/usr/bin/env ruby | ||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'oddb2xml' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
require 'pathname' | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
require 'rubygems' | ||
require 'bundler/setup' | ||
root = Pathname.new(__FILE__).realpath.parent.parent | ||
$:.unshift root.join('lib') if $0 == __FILE__ | ||
|
||
load Gem.bin_path('oddb2xml', 'oddb2xml') | ||
require 'optparse' | ||
require 'oddb2xml' | ||
require 'oddb2xml/options' | ||
|
||
options = Oddb2xml::Options.new | ||
|
||
args = ARGV.dup | ||
begin | ||
options.parser.parse!(args) | ||
rescue OptionParser::MissingArgument, | ||
OptionParser::InvalidArgument, | ||
OptionParser::InvalidOption | ||
puts Oddb2xml::Options.help | ||
exit | ||
end | ||
|
||
opts = options.opts | ||
if args.size > 0 | ||
puts "Please remove unused parameters #{args}" | ||
exit 2 | ||
end | ||
|
||
# TEMP | ||
if path = args.first | ||
opts[:transfer_dat] = path | ||
end | ||
|
||
startTime = 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-startTime).to_i | ||
puts "#{Time.now}: #{__LINE__} done. Took #{diff} seconds"; $stdout.sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.