mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Move "GitHub" special-case to _.capitalize. Add specs.
This commit is contained in:
@@ -53,18 +53,19 @@ _.mixin
|
||||
string.replace(regex, "\\$&");
|
||||
|
||||
humanizeEventName: (eventName, eventDoc) ->
|
||||
return "GitHub" if eventName.toLowerCase() is "github"
|
||||
|
||||
[namespace, event] = eventName.split(':')
|
||||
return _.capitalize(namespace) unless event?
|
||||
|
||||
namespaceDoc = _.undasherize(namespace)
|
||||
eventDoc ||= _.undasherize(event)
|
||||
namespaceDoc = _.undasherize(namespace)
|
||||
eventDoc ?= _.undasherize(event)
|
||||
|
||||
"#{namespaceDoc}: #{eventDoc}"
|
||||
|
||||
capitalize: (word) ->
|
||||
word[0].toUpperCase() + word[1..]
|
||||
if word.toLowerCase() is 'github'
|
||||
'GitHub'
|
||||
else
|
||||
word[0].toUpperCase() + word[1..]
|
||||
|
||||
pluralize: (count=0, singular, plural=singular+'s') ->
|
||||
if count is 1
|
||||
|
||||
Reference in New Issue
Block a user