{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments/44423257","id":44423257,"diff_hunk":"@@ -9,25 +9,78 @@ import scala.util.{Failure, Success, Try}\n trait WdlStandardLibraryFunctions extends WdlFunctions[WdlValue] {\n   private def fail(name: String) = Failure(new UnsupportedOperationException(s\"$name() not implemented yet\"))\n \n+  private def extractObjectOrArray(params: Seq[Try[WdlValue]]) = for {\n+    singleArgument <- extractSingleArgument(params)\n+    contents <- Success(fileContentsToString(singleArgument))\n+    wdlObjects <- WdlObject.fromTsv(contents)\n+  } yield wdlObjects\n+\n   protected def stdout(params: Seq[Try[WdlValue]]): Try[WdlFile] = fail(\"stdout\")\n   protected def stderr(params: Seq[Try[WdlValue]]): Try[WdlFile] = fail(\"stderr\")\n-  protected def read_lines(params: Seq[Try[WdlValue]]): Try[WdlArray] = fail(\"read_lines\")\n-  protected def read_tsv(params: Seq[Try[WdlValue]]): Try[WdlArray] = fail(\"read_tsv\")\n-  protected def read_map(params: Seq[Try[WdlValue]]): Try[WdlMap] = fail(\"read_map\")\n-  protected def read_object(params: Seq[Try[WdlValue]]): Try[WdlObject] = fail(\"read_objects\")\n-  protected def read_objects(params: Seq[Try[WdlValue]]): Try[WdlArray] = fail(\"read_objects\")\n+\n+  /**\n+    * Read all lines from the file referenced by the first parameter and return an Array[String]\n+    */\n+  protected def read_lines(params: Seq[Try[WdlValue]]): Try[WdlArray] = {\n+    for {\n+      singleArgument <- extractSingleArgument(params)\n+      lines = fileContentsToString(singleArgument).split(\"\\n\").map{WdlString}\n+    } yield WdlArray(WdlArrayType(WdlStringType), lines)\n+  }\n+\n+ protected def read_map(params: Seq[Try[WdlValue]]): Try[WdlMap] = {\n+    for {\n+      singleArgument <- extractSingleArgument(params)\n+      contents <- Success(fileContentsToString(singleArgument))","path":"src/main/scala/cromwell/binding/expression/WdlStandardLibraryFunctions.scala","position":31,"original_position":31,"commit_id":"81bb0ea553e2788145b954ee04dd459980a0439c","original_commit_id":"e7904297d3edc757529a5923a11072a644be34b4","user":{"login":"scottfrazer","id":58551,"avatar_url":"https://avatars.githubusercontent.com/u/58551?v=3","gravatar_id":"","url":"https://api.github.com/users/scottfrazer","html_url":"https://github.com/scottfrazer","followers_url":"https://api.github.com/users/scottfrazer/followers","following_url":"https://api.github.com/users/scottfrazer/following{/other_user}","gists_url":"https://api.github.com/users/scottfrazer/gists{/gist_id}","starred_url":"https://api.github.com/users/scottfrazer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottfrazer/subscriptions","organizations_url":"https://api.github.com/users/scottfrazer/orgs","repos_url":"https://api.github.com/users/scottfrazer/repos","events_url":"https://api.github.com/users/scottfrazer/events{/privacy}","received_events_url":"https://api.github.com/users/scottfrazer/received_events","type":"User","site_admin":false},"body":"If we think that `read_string` *should* trim whitespace, then I can add a private method that does the reading but doesn't do the trimming which we can use in all these `read_*` functions","created_at":"2015-11-10T15:56:57Z","updated_at":"2015-11-10T15:56:57Z","html_url":"https://github.com/broadinstitute/cromwell/pull/283#discussion_r44423257","pull_request_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/283","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments/44423257"},"html":{"href":"https://github.com/broadinstitute/cromwell/pull/283#discussion_r44423257"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/283"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/283","id":50260827,"html_url":"https://github.com/broadinstitute/cromwell/pull/283","diff_url":"https://github.com/broadinstitute/cromwell/pull/283.diff","patch_url":"https://github.com/broadinstitute/cromwell/pull/283.patch","issue_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/283","number":283,"state":"open","locked":false,"title":"read_tsv","user":{"login":"scottfrazer","id":58551,"avatar_url":"https://avatars.githubusercontent.com/u/58551?v=3","gravatar_id":"","url":"https://api.github.com/users/scottfrazer","html_url":"https://github.com/scottfrazer","followers_url":"https://api.github.com/users/scottfrazer/followers","following_url":"https://api.github.com/users/scottfrazer/following{/other_user}","gists_url":"https://api.github.com/users/scottfrazer/gists{/gist_id}","starred_url":"https://api.github.com/users/scottfrazer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottfrazer/subscriptions","organizations_url":"https://api.github.com/users/scottfrazer/orgs","repos_url":"https://api.github.com/users/scottfrazer/repos","events_url":"https://api.github.com/users/scottfrazer/events{/privacy}","received_events_url":"https://api.github.com/users/scottfrazer/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-10T14:37:40Z","updated_at":"2015-11-10T15:56:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b85b4e0c754796db4199eded656aefab65346da3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/283/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/283/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/283/comments","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/81bb0ea553e2788145b954ee04dd459980a0439c","head":{"label":"broadinstitute:read_tsv","ref":"read_tsv","sha":"81bb0ea553e2788145b954ee04dd459980a0439c","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34136406,"name":"cromwell","full_name":"broadinstitute/cromwell","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/cromwell","description":"Workflow Execution Engine using WDL","fork":false,"url":"https://api.github.com/repos/broadinstitute/cromwell","forks_url":"https://api.github.com/repos/broadinstitute/cromwell/forks","keys_url":"https://api.github.com/repos/broadinstitute/cromwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/cromwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/cromwell/teams","hooks_url":"https://api.github.com/repos/broadinstitute/cromwell/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/cromwell/events","assignees_url":"https://api.github.com/repos/broadinstitute/cromwell/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/cromwell/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/cromwell/tags","blobs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/cromwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/cromwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/cromwell/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/cromwell/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/cromwell/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/cromwell/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/cromwell/subscription","commits_url":"https://api.github.com/repos/broadinstitute/cromwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/cromwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/cromwell/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/cromwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/cromwell/merges","archive_url":"https://api.github.com/repos/broadinstitute/cromwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/cromwell/downloads","issues_url":"https://api.github.com/repos/broadinstitute/cromwell/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/cromwell/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/cromwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/cromwell/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/cromwell/releases{/id}","created_at":"2015-04-17T19:39:36Z","updated_at":"2015-10-13T18:11:00Z","pushed_at":"2015-11-10T15:49:18Z","git_url":"git://github.com/broadinstitute/cromwell.git","ssh_url":"git@github.com:broadinstitute/cromwell.git","clone_url":"https://github.com/broadinstitute/cromwell.git","svn_url":"https://github.com/broadinstitute/cromwell","homepage":"","size":7396,"stargazers_count":9,"watchers_count":9,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":9,"default_branch":"develop"}},"base":{"label":"broadinstitute:develop","ref":"develop","sha":"b6b5f19834a84167e45619e2f47400183f5284e7","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34136406,"name":"cromwell","full_name":"broadinstitute/cromwell","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/cromwell","description":"Workflow Execution Engine using WDL","fork":false,"url":"https://api.github.com/repos/broadinstitute/cromwell","forks_url":"https://api.github.com/repos/broadinstitute/cromwell/forks","keys_url":"https://api.github.com/repos/broadinstitute/cromwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/cromwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/cromwell/teams","hooks_url":"https://api.github.com/repos/broadinstitute/cromwell/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/cromwell/events","assignees_url":"https://api.github.com/repos/broadinstitute/cromwell/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/cromwell/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/cromwell/tags","blobs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/cromwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/cromwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/cromwell/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/cromwell/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/cromwell/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/cromwell/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/cromwell/subscription","commits_url":"https://api.github.com/repos/broadinstitute/cromwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/cromwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/cromwell/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/cromwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/cromwell/merges","archive_url":"https://api.github.com/repos/broadinstitute/cromwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/cromwell/downloads","issues_url":"https://api.github.com/repos/broadinstitute/cromwell/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/cromwell/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/cromwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/cromwell/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/cromwell/releases{/id}","created_at":"2015-04-17T19:39:36Z","updated_at":"2015-10-13T18:11:00Z","pushed_at":"2015-11-10T15:49:18Z","git_url":"git://github.com/broadinstitute/cromwell.git","ssh_url":"git@github.com:broadinstitute/cromwell.git","clone_url":"https://github.com/broadinstitute/cromwell.git","svn_url":"https://github.com/broadinstitute/cromwell","homepage":"","size":7396,"stargazers_count":9,"watchers_count":9,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/283"},"html":{"href":"https://github.com/broadinstitute/cromwell/pull/283"},"issue":{"href":"https://api.github.com/repos/broadinstitute/cromwell/issues/283"},"comments":{"href":"https://api.github.com/repos/broadinstitute/cromwell/issues/283/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/283/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/283/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/cromwell/statuses/81bb0ea553e2788145b954ee04dd459980a0439c"}}}}