duckduckgo / p5-app-duckpan

DuckDuckHack OpenSource Development Application
http://metacpan.org/module/App::DuckPAN
Other
53 stars 47 forks source link

DuckPAN New - Should error when input name has spaces (or cleverly remove them) #110

Closed moollaza closed 10 years ago

moollaza commented 10 years ago

2014-08-26_12h19_57

moollaza commented 10 years ago

We should provide an explanation of the what name is for (i.e. it will become the filename) and we should tell them it should be CamelCased and it shouldn't contain any spaces

jagtalon commented 10 years ago

@moollaza I think it would be better if we abstracted away the camel-casing from the user:

"the walking dead" => "TheWalkingDead.pm" and "the_walking_dead.js" "thewalkingdead" => "Thewalkingdead.pm" and "thewalkingdead.js" "the_walking_dead" => "TheWalkingDead.pm" and "the_walking_dead.js" "The Walking dead" => "TheWalkingDead.pm" and "the_walking_dead.js"

There might be other input variations that I forgot. Any invalid characters in the string would be rejected / escaped.

jagtalon commented 10 years ago

@moollaza is it possible to remove the extra newlines from the output?

moollaza commented 10 years ago

@jagtalon if we're going to abstract it then I think we would have to confirm with them the text that is going to be used -- I don't like the idea of magically modifying their input. IMHO it makes the most sense to force them to choose an appropriate package name, or pull out spaces from the name and CamelCase that appropriately to create the name -- any errors should cause a reprompt so we don't create move forward with a name the dev doesn't want/like.

FWIW I think it might be a little easier to use a prompt lib like https://metacpan.org/pod/IO::Prompt to make all this easier -- cc// @DavidMascio

moollaza commented 10 years ago

Fixed with #110

jagtalon commented 10 years ago

@moollaza Fair enough. As long as it errors out for invalid input is what matters.