Skip to content

Commit d6f0844

Browse files
committed
Preserve ALLCAPS class names, but this does not apply to ALL_CAPS which becomes AllCaps.
1 parent f5e598d commit d6f0844

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/ruby-bindgen/refinements/string.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def camelize()
1414
return self.capitalize
1515
end
1616

17+
return self if self.match?(/\A[A-Z]+\z/)
18+
1719
input = self.match?(/\A[A-Z_0-9]*\z/) ? self.downcase : self
1820
string = input.sub(/^[a-z\d]*/) { |match| match.capitalize! || match }
1921
string.gsub!(/\/, ::/)

test/bindings/cpp/default_values-rb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void Init_DefaultValues()
6464
.define_attr("max_val", &ml::ParamGrid::maxVal)
6565
.define_attr("log_step", &ml::ParamGrid::logStep);
6666

67-
Rice::Data_Type<ml::SVM> rb_cMlSVM = define_class_under<ml::SVM>(rb_mMl, "Svm")
67+
Rice::Data_Type<ml::SVM> rb_cMlSVM = define_class_under<ml::SVM>(rb_mMl, "SVM")
6868
.define_constructor(Constructor<ml::SVM>())
6969
.define_singleton_function<ml::ParamGrid(*)(int)>("get_default_grid", &ml::SVM::getDefaultGrid,
7070
Arg("param_id"))

0 commit comments

Comments
 (0)