Skip to content

Conversation

chrismccord
Copy link
Contributor

Currently, snake cased project names did not get converted properly into modules from Mix.Utils.command_to_module_name, i.e.:

Mix.Utils.command_to_module_name "my_app.task"
=> "My_app.Task"

This PR uses camelize to properly convert the commands to module namespaces.

@ericmj
Copy link
Member

ericmj commented Nov 12, 2014

👍

@@ -284,7 +284,7 @@ defmodule Mix.Utils do
"""
def command_to_module_name(s) do
Regex.split(~r/\./, to_string(s)) |>
Enum.map(&first_to_upper(&1)) |>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem we use first_to_upper anymore. Plus module_name_to_command uses first_to_lower which we should probably fix and remove too. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I'll make these changes this evening

@chrismccord
Copy link
Contributor Author

@josevalim Updated and ready to go

josevalim added a commit that referenced this pull request Nov 13, 2014
Fix command_to_module_name not converting snakecased names properly
@josevalim josevalim merged commit 5b71f57 into elixir-lang:master Nov 13, 2014
josevalim added a commit that referenced this pull request Nov 13, 2014
Fix command_to_module_name not converting snakecased names properly

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants