-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes: - `UpperCase` renamed to `PascalCase` - `Recase.to_upper/1` renamed to `Recase.to_pascal/1` - `upper_case_test.exs` renamed to `pascal_case_test.exs` - Made changes to reflect `Pascal` and `Upper` case issue Closes #2
- Loading branch information
Showing
8 changed files
with
74 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
defmodule Recase.PascalCase do | ||
@moduledoc """ | ||
Module to convert strings to `PascalCase` aka `UpperCase`. | ||
This module should not be used directly. | ||
Read about `PascalCase` here: | ||
https://en.wikipedia.org/wiki/PascalCase | ||
## Changed | ||
This name was introduced in version `0.2.0`, | ||
it was named `UpperCase` before. | ||
But `UpperCase` was not clear enough. What is `uppercase`? | ||
1. THIS IS UPPERCASE | ||
2. ThisIsAlsoUpperCase | ||
So, it was decided to rename this module into `PascalCase`. | ||
For other details see: https://github.com/sobolevn/recase/issues/2 | ||
""" | ||
|
||
alias Recase.CamelCase | ||
|
||
@spec convert(String.t) :: String.t | ||
def convert(""), do: "" | ||
def convert(value) do | ||
<<char::binary-size(1), rest::binary>> = CamelCase.convert(value) | ||
String.upcase(char) <> rest | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
test/recase_test/upper_case_test.exs → test/recase_test/pascal_case_test.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters