Changeset 1800
- Timestamp:
- 05/21/07 21:55:21 (2 years ago)
- Files:
-
- trunk/lib/soap/mapping/mapping.rb (modified) (1 diff)
- trunk/lib/xsd/codegen/gensupport.rb (modified) (1 diff)
- trunk/lib/xsd/ns.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/soap/mapping/mapping.rb
r1788 r1800 215 215 const = ::Object 216 216 name.sub(/\A::/, '').split('::').each do |const_str| 217 if XSD::CodeGen::GenSupport.safeconstname?(const_str)217 begin 218 218 if const.const_defined?(const_str) 219 219 const = const.const_get(const_str) 220 220 next 221 221 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 227 229 end 228 230 end trunk/lib/xsd/codegen/gensupport.rb
r1791 r1800 155 155 module GenSupport 156 156 def capitalize(target) 157 target.sub(/^([a-z])/) { $1. tr!('[a-z]', '[A-Z]')}157 target.sub(/^([a-z])/) { $1.upcase } 158 158 end 159 159 module_function :capitalize 160 160 161 161 def uncapitalize(target) 162 target.sub(/^([A-Z])/) { $1. tr!('[A-Z]', '[a-z]')}162 target.sub(/^([A-Z])/) { $1.downcase } 163 163 end 164 164 module_function :uncapitalize trunk/lib/xsd/ns.rb
r1704 r1800 92 92 93 93 # $1 and $2 are necessary. 94 ParseRegexp = Regexp.new(' ^([^:]+)(?::(.+))?$')94 ParseRegexp = Regexp.new('\A([^:]+)(?::(.+))?\z') 95 95 96 96 def parse(str, local = false)