Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Remove unnecessary code and update the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
akaralar committed Apr 26, 2016
1 parent 8682f90 commit 9a66ac5
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 47 deletions.
Binary file modified Safari History Search.alfredworkflow
Binary file not shown.
23 changes: 0 additions & 23 deletions SafariHistorySearch.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,6 @@ struct HistoryItem {
func alfredResult() -> AlfredResult? {
return url != nil ? AlfredResult(fromHistoryItem: self) : nil
}

func contains(queries: [String]) -> Bool {
for query in queries {
if !contains(query) {
return false
}
}
return true
}

func contains(query: String) -> Bool {
return matches(query, inString: self.name) ||
matches(query, inString: self.url?.path) ||
matches(query, inString: self.fullText)
}

func matches(query: String, inString string: String?) -> Bool {
guard let stringToSearch = string else {
return false
}

return stringToSearch.containsString(query)
}
}

struct AlfredResult {
Expand Down
Binary file not shown.
Binary file modified safariSearch
Binary file not shown.
25 changes: 1 addition & 24 deletions safariSearch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,7 @@ struct HistoryItem {

func alfredResult() -> AlfredResult? {
return url != nil ? AlfredResult(fromHistoryItem: self) : nil
}

func contains(queries: [String]) -> Bool {
for query in queries {
if !contains(query) {
return false
}
}
return true
}

func contains(query: String) -> Bool {
return matches(query, inString: self.name) ||
matches(query, inString: self.url?.path) ||
matches(query, inString: self.fullText)
}

func matches(query: String, inString string: String?) -> Bool {
guard let stringToSearch = string else {
return false
}

return stringToSearch.containsString(query)
}
}
}

struct AlfredResult {
Expand Down

0 comments on commit 9a66ac5

Please sign in to comment.