Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote whitespace-containing arguments in Task.description #63

Merged
merged 6 commits into from
Jul 5, 2016

Conversation

ikesyo
Copy link
Member

@ikesyo ikesyo commented Jul 3, 2016

@@ -48,6 +48,13 @@ public struct Task {

extension Task: CustomStringConvertible {
public var description: String {
let arguments = self.arguments.map { argument -> String in
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe extract this into a escape function in a String extension?

@ikesyo
Copy link
Member Author

ikesyo commented Jul 5, 2016

Updated ✨ How does it look like now?

@ikesyo ikesyo changed the title Quote space-containing arguments in Task.description Quote whitespace-containing arguments in Task.description Jul 5, 2016
private extension CollectionType where Generator.Element == String {
func escaped() -> [String] {
let whitespaceCharacterSet = NSCharacterSet.whitespaceCharacterSet()
return map { string -> String in
Copy link
Contributor

Choose a reason for hiding this comment

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

The return type here is redundant.

@@ -46,9 +46,20 @@ public struct Task {
}
}

private extension String {
var escaped: String {
let whitespaceCharacterSet = NSCharacterSet.whitespaceCharacterSet()
Copy link
Member Author

Choose a reason for hiding this comment

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

Calling this for each call would be okay?

@mdiep
Copy link
Member

mdiep commented Jul 5, 2016

🚢

@mdiep mdiep merged commit cc4b2e2 into master Jul 5, 2016
@mdiep mdiep deleted the fix-task-description branch July 5, 2016 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants