Welcome to the "trac"-ing site of soap4r!
[soap4r] [httpclient] [openpgp4u] [pkcs1] [logger] [csv] [vtr]

Changeset 697

Show
Ignore:
Timestamp:
01/12/03 14:45:19 (6 years ago)
Author:
nahi
Message:

Required non-existing file. Fixed.
Add --force option to override existing file.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bin/wsdl2ruby.rb

    r624 r697  
    22 
    33require 'getoptlong' 
     4require 'soap/qname' 
    45require 'wsdl/parser' 
    5 require 'wsdl/name' 
    66require 'wsdl/soap/classDefCreator' 
    77require 'wsdl/soap/servantSkeltonCreator' 
     
    2020    ['--wsdl','-w', GetoptLong::REQUIRED_ARGUMENT], 
    2121    ['--type','-t', GetoptLong::REQUIRED_ARGUMENT], 
    22     ['--classDef','-f', GetoptLong::NO_ARGUMENT], 
     22    ['--classDef','-e', GetoptLong::NO_ARGUMENT], 
    2323    ['--clientSkelton','-c', GetoptLong::OPTIONAL_ARGUMENT], 
    2424    ['--servantSkelton','-s', GetoptLong::OPTIONAL_ARGUMENT], 
     
    2626    ['--webrickStub','-b', GetoptLong::OPTIONAL_ARGUMENT], 
    2727    ['--standaloneServerStub','-a', GetoptLong::OPTIONAL_ARGUMENT], 
    28     ['--driver','-d', GetoptLong::OPTIONAL_ARGUMENT] 
     28    ['--driver','-d', GetoptLong::OPTIONAL_ARGUMENT], 
     29    ['--force','-f', GetoptLong::NO_ARGUMENT], 
    2930  ] 
    3031 
     
    8485  --standaloneServerStub [serviceName] 
    8586  --driver [portTypeName] 
     87  --force 
    8688 
    8789Terminology: 
     
    118120            "--webrickStub", "--standaloneServerStub", "--driver" 
    119121          opt[ name.sub( /^--/, '' ) ] = arg.empty? ? nil : arg 
     122        when "--force" 
     123          opt[ 'force' ] = true 
    120124        else 
    121125          raise ArgumentError.new( "Unknown type #{ arg }" ) 
     
    213217  def checkFile( filename ) 
    214218    if FileTest.exist?( filename ) 
    215       log( SEV_WARN ) { 
    216         "File '#{ filename }' exists.  #{ $0 } did not override it." } 
    217       false 
     219      if @opt.has_key?( 'force' ) 
     220        log( SEV_WARN ) { 
     221          "File '#{ filename }' exists but overrides it." 
     222        } 
     223        true 
     224      else 
     225        log( SEV_WARN ) { 
     226          "File '#{ filename }' exists.  #{ $0 } did not override it." 
     227        } 
     228        false 
     229      end 
    218230    else 
    219231      log( SEV_INFO ) { "Creates file '#{ filename }'." }