Sha256: f9691ebe8c27d81d3fadce70e233e4333085ff351e96c84f79395a75f7ea3a8f
Contents?: true
Size: 1.19 KB
Versions: 1
Compression:
Stored size: 1.19 KB
Contents
#!/usr/bin/env ruby # # Created on 2008-8-19. # Copyright (c) 2008. All rights reserved. begin require 'rubygems' rescue LoadError # no rubygems to load, so we fail silently end require 'optparse' require 'sogoumap2pdf' include Sogoumap2pdf # NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application. OPTIONS = { :path => '~' } MANDATORY_OPTIONS = %w( ) parser = OptionParser.new do |opts| opts.banner = <<BANNER This application is wonderful because... Usage: #{File.basename($0)} [options] Options are: BANNER opts.separator "" opts.on("-p", "--path=PATH", String, "The root path for selecting files", "Default: ~") { |OPTIONS[:path]| } opts.on("-h", "--help", "Show this help message.") { puts opts; exit } opts.parse!(ARGV) if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? } puts opts; exit end end path = OPTIONS[:path] # do stuff g=SogouMapImage.new(ARGV[0], ARGV[6]) gmpdf=ImageToPdf.new(".JPG") xres, yres = gmpdf.perfect_fit(ARGV[1].to_i,ARGV[2].to_i,ARGV[3].to_i,ARGV[4].to_i) g.fill_map(xres,yres) gmpdf.front_page(g) gmpdf.create_pages(g) gmpdf.save
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sogoumap2pdf-0.0.1 | bin/sogoumap2pdf |