Mattflaschen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/254369

Change subject: Correctly capitalize only first letter of username; leave rest 
alone
......................................................................

Correctly capitalize only first letter of username; leave rest alone

Minor style change

Follows-up: 290e200ec44b014cf8c279d71f02609a783f0d48

Change-Id: I03d5ec1253505e45f6ba9f2de2999c87e68e5763
---
M puppet/modules/mediawiki/manifests/user.pp
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/69/254369/1

diff --git a/puppet/modules/mediawiki/manifests/user.pp 
b/puppet/modules/mediawiki/manifests/user.pp
index 0c5902e..cb6900b 100644
--- a/puppet/modules/mediawiki/manifests/user.pp
+++ b/puppet/modules/mediawiki/manifests/user.pp
@@ -42,7 +42,7 @@
     $username = $title,
     $email    = undef,
     $wiki     = $::mediawiki::db_name,
-    $groups   = []
+    $groups   = [],
 ) {
     include ::mediawiki
 
@@ -50,7 +50,10 @@
     # In the meantime, just address one common issue.
 
     # Capitalize first character
-    $canonical_username = capitalize($username)
+    # Ruby's capitalize has a bug/feature where it *lower-cases* every
+    # character except the first even when they were already
+    # capitalized.  Puppet inherits this.
+    $canonical_username = inline_template('<%= @username[0].capitalize + 
@username[1..-1] %>')
 
     exec { "mediawiki_user_${canonical_username}_${wiki}":
         command => "/usr/local/bin/mwscript createAndPromote.php \

-- 
To view, visit https://gerrit.wikimedia.org/r/254369
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I03d5ec1253505e45f6ba9f2de2999c87e68e5763
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to