diff options
Diffstat (limited to 'subversion/bindings/swig/ruby/svn/util.rb')
-rw-r--r-- | subversion/bindings/swig/ruby/svn/util.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/subversion/bindings/swig/ruby/svn/util.rb b/subversion/bindings/swig/ruby/svn/util.rb index 8e05367..d409b98 100644 --- a/subversion/bindings/swig/ruby/svn/util.rb +++ b/subversion/bindings/swig/ruby/svn/util.rb @@ -36,8 +36,13 @@ module Svn module Util #:nodoc: module_function def to_ruby_class_name(name) + # Convert to CamelCase with 'X' for a leading/double/trailing underscore. name.to_s.split("_").collect do |x| - "#{x[0,1].upcase}#{x[1..-1].downcase}" + if x.empty? + "X" + else + x.capitalize + end end.join("") end @@ -70,6 +75,8 @@ module Svn target_name = $POSTMATCH when /^SWIG_SVN_/ target_name = $POSTMATCH + when /^Svn_(?:#{target_mod.name.split("::").last.downcase}_)?_(.+)_t$/ + # ignore private types when /^Svn_(?:#{target_mod.name.split("::").last.downcase}_)?(.+)_t$/ target_name = to_ruby_class_name($1) when /^Svn_(?:#{target_mod.name.split("::").last.downcase}_)?/ |