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

Changeset 1800

Show
Ignore:
Timestamp:
05/21/07 21:55:21 (2 years ago)
Author:
nahi
Message:
  • for speed performance.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/soap/mapping/mapping.rb

    r1788 r1800  
    215215    const = ::Object 
    216216    name.sub(/\A::/, '').split('::').each do |const_str| 
    217       if XSD::CodeGen::GenSupport.safeconstname?(const_str) 
     217      begin 
    218218        if const.const_defined?(const_str) 
    219219          const = const.const_get(const_str) 
    220220          next 
    221221        end 
    222       elsif lenient 
    223         const_str = XSD::CodeGen::GenSupport.safeconstname(const_str) 
    224         if const.const_defined?(const_str) 
    225           const = const.const_get(const_str) 
    226           next 
     222      rescue NameError 
     223        if lenient 
     224          const_str = XSD::CodeGen::GenSupport.safeconstname(const_str) 
     225          if const.const_defined?(const_str) 
     226            const = const.const_get(const_str) 
     227            next 
     228          end 
    227229        end 
    228230      end 
  • trunk/lib/xsd/codegen/gensupport.rb

    r1791 r1800  
    155155module GenSupport 
    156156  def capitalize(target) 
    157     target.sub(/^([a-z])/) { $1.tr!('[a-z]', '[A-Z]')
     157    target.sub(/^([a-z])/) { $1.upcase
    158158  end 
    159159  module_function :capitalize 
    160160 
    161161  def uncapitalize(target) 
    162     target.sub(/^([A-Z])/) { $1.tr!('[A-Z]', '[a-z]')
     162    target.sub(/^([A-Z])/) { $1.downcase
    163163  end 
    164164  module_function :uncapitalize 
  • trunk/lib/xsd/ns.rb

    r1704 r1800  
    9292 
    9393  # $1 and $2 are necessary. 
    94   ParseRegexp = Regexp.new('^([^:]+)(?::(.+))?$') 
     94  ParseRegexp = Regexp.new('\A([^:]+)(?::(.+))?\z') 
    9595 
    9696  def parse(str, local = false)