{"action":"opened","number":1549,"pull_request":{"url":"https://api.github.com/repos/manastech/crystal/pulls/1549","id":45604835,"html_url":"https://github.com/manastech/crystal/pull/1549","diff_url":"https://github.com/manastech/crystal/pull/1549.diff","patch_url":"https://github.com/manastech/crystal/pull/1549.patch","issue_url":"https://api.github.com/repos/manastech/crystal/issues/1549","number":1549,"state":"open","locked":false,"title":"File#truncate","user":{"login":"porras","id":3830,"avatar_url":"https://avatars.githubusercontent.com/u/3830?v=3","gravatar_id":"","url":"https://api.github.com/users/porras","html_url":"https://github.com/porras","followers_url":"https://api.github.com/users/porras/followers","following_url":"https://api.github.com/users/porras/following{/other_user}","gists_url":"https://api.github.com/users/porras/gists{/gist_id}","starred_url":"https://api.github.com/users/porras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/porras/subscriptions","organizations_url":"https://api.github.com/users/porras/orgs","repos_url":"https://api.github.com/users/porras/repos","events_url":"https://api.github.com/users/porras/events{/privacy}","received_events_url":"https://api.github.com/users/porras/received_events","type":"User","site_admin":false},"body":"This PR implements `File#truncate`, a direct mapping to the `ftruncate` system call, and equivalent to [Ruby's method](http://www.rubydoc.info/stdlib/core/File#truncate-instance_method). The spec shows a use case that comes to mind: opening a file with `r+`, reading it complete, and then overwriting it completely (if the new content is shorter than the old, we need to truncate).","created_at":"2015-09-21T21:51:01Z","updated_at":"2015-09-21T21:51:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/manastech/crystal/pulls/1549/commits","review_comments_url":"https://api.github.com/repos/manastech/crystal/pulls/1549/comments","review_comment_url":"https://api.github.com/repos/manastech/crystal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/1549/comments","statuses_url":"https://api.github.com/repos/manastech/crystal/statuses/561b2568d8063c43cb2f872a66b1106400d8e507","head":{"label":"porras:File#truncate","ref":"File#truncate","sha":"561b2568d8063c43cb2f872a66b1106400d8e507","user":{"login":"porras","id":3830,"avatar_url":"https://avatars.githubusercontent.com/u/3830?v=3","gravatar_id":"","url":"https://api.github.com/users/porras","html_url":"https://github.com/porras","followers_url":"https://api.github.com/users/porras/followers","following_url":"https://api.github.com/users/porras/following{/other_user}","gists_url":"https://api.github.com/users/porras/gists{/gist_id}","starred_url":"https://api.github.com/users/porras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/porras/subscriptions","organizations_url":"https://api.github.com/users/porras/orgs","repos_url":"https://api.github.com/users/porras/repos","events_url":"https://api.github.com/users/porras/events{/privacy}","received_events_url":"https://api.github.com/users/porras/received_events","type":"User","site_admin":false},"repo":{"id":32145827,"name":"crystal","full_name":"porras/crystal","owner":{"login":"porras","id":3830,"avatar_url":"https://avatars.githubusercontent.com/u/3830?v=3","gravatar_id":"","url":"https://api.github.com/users/porras","html_url":"https://github.com/porras","followers_url":"https://api.github.com/users/porras/followers","following_url":"https://api.github.com/users/porras/following{/other_user}","gists_url":"https://api.github.com/users/porras/gists{/gist_id}","starred_url":"https://api.github.com/users/porras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/porras/subscriptions","organizations_url":"https://api.github.com/users/porras/orgs","repos_url":"https://api.github.com/users/porras/repos","events_url":"https://api.github.com/users/porras/events{/privacy}","received_events_url":"https://api.github.com/users/porras/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/porras/crystal","description":"The Crystal Programming Language","fork":true,"url":"https://api.github.com/repos/porras/crystal","forks_url":"https://api.github.com/repos/porras/crystal/forks","keys_url":"https://api.github.com/repos/porras/crystal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/porras/crystal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/porras/crystal/teams","hooks_url":"https://api.github.com/repos/porras/crystal/hooks","issue_events_url":"https://api.github.com/repos/porras/crystal/issues/events{/number}","events_url":"https://api.github.com/repos/porras/crystal/events","assignees_url":"https://api.github.com/repos/porras/crystal/assignees{/user}","branches_url":"https://api.github.com/repos/porras/crystal/branches{/branch}","tags_url":"https://api.github.com/repos/porras/crystal/tags","blobs_url":"https://api.github.com/repos/porras/crystal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/porras/crystal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/porras/crystal/git/refs{/sha}","trees_url":"https://api.github.com/repos/porras/crystal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/porras/crystal/statuses/{sha}","languages_url":"https://api.github.com/repos/porras/crystal/languages","stargazers_url":"https://api.github.com/repos/porras/crystal/stargazers","contributors_url":"https://api.github.com/repos/porras/crystal/contributors","subscribers_url":"https://api.github.com/repos/porras/crystal/subscribers","subscription_url":"https://api.github.com/repos/porras/crystal/subscription","commits_url":"https://api.github.com/repos/porras/crystal/commits{/sha}","git_commits_url":"https://api.github.com/repos/porras/crystal/git/commits{/sha}","comments_url":"https://api.github.com/repos/porras/crystal/comments{/number}","issue_comment_url":"https://api.github.com/repos/porras/crystal/issues/comments{/number}","contents_url":"https://api.github.com/repos/porras/crystal/contents/{+path}","compare_url":"https://api.github.com/repos/porras/crystal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/porras/crystal/merges","archive_url":"https://api.github.com/repos/porras/crystal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/porras/crystal/downloads","issues_url":"https://api.github.com/repos/porras/crystal/issues{/number}","pulls_url":"https://api.github.com/repos/porras/crystal/pulls{/number}","milestones_url":"https://api.github.com/repos/porras/crystal/milestones{/number}","notifications_url":"https://api.github.com/repos/porras/crystal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/porras/crystal/labels{/name}","releases_url":"https://api.github.com/repos/porras/crystal/releases{/id}","created_at":"2015-03-13T09:00:17Z","updated_at":"2015-03-13T09:00:18Z","pushed_at":"2015-09-21T21:39:26Z","git_url":"git://github.com/porras/crystal.git","ssh_url":"git@github.com:porras/crystal.git","clone_url":"https://github.com/porras/crystal.git","svn_url":"https://github.com/porras/crystal","homepage":"http://crystal-lang.org","size":25638,"stargazers_count":0,"watchers_count":0,"language":"Crystal","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"manastech:master","ref":"master","sha":"9423b4c9b6f011aa266fab2230a3d457b1a56300","user":{"login":"manastech","id":1354950,"avatar_url":"https://avatars.githubusercontent.com/u/1354950?v=3","gravatar_id":"","url":"https://api.github.com/users/manastech","html_url":"https://github.com/manastech","followers_url":"https://api.github.com/users/manastech/followers","following_url":"https://api.github.com/users/manastech/following{/other_user}","gists_url":"https://api.github.com/users/manastech/gists{/gist_id}","starred_url":"https://api.github.com/users/manastech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manastech/subscriptions","organizations_url":"https://api.github.com/users/manastech/orgs","repos_url":"https://api.github.com/users/manastech/repos","events_url":"https://api.github.com/users/manastech/events{/privacy}","received_events_url":"https://api.github.com/users/manastech/received_events","type":"Organization","site_admin":false},"repo":{"id":6887813,"name":"crystal","full_name":"manastech/crystal","owner":{"login":"manastech","id":1354950,"avatar_url":"https://avatars.githubusercontent.com/u/1354950?v=3","gravatar_id":"","url":"https://api.github.com/users/manastech","html_url":"https://github.com/manastech","followers_url":"https://api.github.com/users/manastech/followers","following_url":"https://api.github.com/users/manastech/following{/other_user}","gists_url":"https://api.github.com/users/manastech/gists{/gist_id}","starred_url":"https://api.github.com/users/manastech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manastech/subscriptions","organizations_url":"https://api.github.com/users/manastech/orgs","repos_url":"https://api.github.com/users/manastech/repos","events_url":"https://api.github.com/users/manastech/events{/privacy}","received_events_url":"https://api.github.com/users/manastech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/manastech/crystal","description":"The Crystal Programming Language","fork":false,"url":"https://api.github.com/repos/manastech/crystal","forks_url":"https://api.github.com/repos/manastech/crystal/forks","keys_url":"https://api.github.com/repos/manastech/crystal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manastech/crystal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manastech/crystal/teams","hooks_url":"https://api.github.com/repos/manastech/crystal/hooks","issue_events_url":"https://api.github.com/repos/manastech/crystal/issues/events{/number}","events_url":"https://api.github.com/repos/manastech/crystal/events","assignees_url":"https://api.github.com/repos/manastech/crystal/assignees{/user}","branches_url":"https://api.github.com/repos/manastech/crystal/branches{/branch}","tags_url":"https://api.github.com/repos/manastech/crystal/tags","blobs_url":"https://api.github.com/repos/manastech/crystal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manastech/crystal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manastech/crystal/git/refs{/sha}","trees_url":"https://api.github.com/repos/manastech/crystal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manastech/crystal/statuses/{sha}","languages_url":"https://api.github.com/repos/manastech/crystal/languages","stargazers_url":"https://api.github.com/repos/manastech/crystal/stargazers","contributors_url":"https://api.github.com/repos/manastech/crystal/contributors","subscribers_url":"https://api.github.com/repos/manastech/crystal/subscribers","subscription_url":"https://api.github.com/repos/manastech/crystal/subscription","commits_url":"https://api.github.com/repos/manastech/crystal/commits{/sha}","git_commits_url":"https://api.github.com/repos/manastech/crystal/git/commits{/sha}","comments_url":"https://api.github.com/repos/manastech/crystal/comments{/number}","issue_comment_url":"https://api.github.com/repos/manastech/crystal/issues/comments{/number}","contents_url":"https://api.github.com/repos/manastech/crystal/contents/{+path}","compare_url":"https://api.github.com/repos/manastech/crystal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manastech/crystal/merges","archive_url":"https://api.github.com/repos/manastech/crystal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manastech/crystal/downloads","issues_url":"https://api.github.com/repos/manastech/crystal/issues{/number}","pulls_url":"https://api.github.com/repos/manastech/crystal/pulls{/number}","milestones_url":"https://api.github.com/repos/manastech/crystal/milestones{/number}","notifications_url":"https://api.github.com/repos/manastech/crystal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manastech/crystal/labels{/name}","releases_url":"https://api.github.com/repos/manastech/crystal/releases{/id}","created_at":"2012-11-27T17:32:32Z","updated_at":"2015-09-21T18:33:33Z","pushed_at":"2015-09-21T21:34:57Z","git_url":"git://github.com/manastech/crystal.git","ssh_url":"git@github.com:manastech/crystal.git","clone_url":"https://github.com/manastech/crystal.git","svn_url":"https://github.com/manastech/crystal","homepage":"http://crystal-lang.org","size":46526,"stargazers_count":3386,"watchers_count":3386,"language":"Crystal","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":251,"mirror_url":null,"open_issues_count":227,"forks":251,"open_issues":227,"watchers":3386,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/manastech/crystal/pulls/1549"},"html":{"href":"https://github.com/manastech/crystal/pull/1549"},"issue":{"href":"https://api.github.com/repos/manastech/crystal/issues/1549"},"comments":{"href":"https://api.github.com/repos/manastech/crystal/issues/1549/comments"},"review_comments":{"href":"https://api.github.com/repos/manastech/crystal/pulls/1549/comments"},"review_comment":{"href":"https://api.github.com/repos/manastech/crystal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/manastech/crystal/pulls/1549/commits"},"statuses":{"href":"https://api.github.com/repos/manastech/crystal/statuses/561b2568d8063c43cb2f872a66b1106400d8e507"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":37,"deletions":0,"changed_files":2}}