GitHub PullRequestEvent at 2014-08-25 21:06:59
Repository: opal
Actor: meh
Payload: {"action":"closed","number":551,"pull_request":{"url":"https://api.github.com/repos/opal/opal/pulls/551","id":17165712,"html_url":"https://github.com/opal/opal/pull/551","diff_url":"https://github.com/opal/opal/pull/551.diff","patch_url":"https://github.com/opal/opal/pull/551.patch","issue_url":"https://api.github.com/repos/opal/opal/issues/551","number":551,"state":"closed","locked":false,"title":"Fix String#to_proc","user":{"login":"yhara","id":12285,"avatar_url":"https://avatars.githubusercontent.com/u/12285?v=2","gravatar_id":"22270b6a4e909f6b926fa272596d41b9","url":"https://api.github.com/users/yhara","html_url":"https://github.com/yhara","followers_url":"https://api.github.com/users/yhara/followers","following_url":"https://api.github.com/users/yhara/following{/other_user}","gists_url":"https://api.github.com/users/yhara/gists{/gist_id}","starred_url":"https://api.github.com/users/yhara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhara/subscriptions","organizations_url":"https://api.github.com/users/yhara/orgs","repos_url":"https://api.github.com/users/yhara/repos","events_url":"https://api.github.com/users/yhara/events{/privacy}","received_events_url":"https://api.github.com/users/yhara/received_events","type":"User","site_admin":false},"body":"This PR fixes this code raises \"NoMethodError: undefined method `last' for 1\".\r\n\r\n```rb\r\n[[1,2],[3,4]].map(&:last)\r\n```\r\nLink: http://opalrb.org/try/#code:%5B%5B1%2C2%5D%2C%5B3%2C4%5D%5D.map(%26%3Alast)%0A%0A%0A\r\n\r\nThis implementation is same as [Symbol#to_proc in Rubinius](https://github.com/rubinius/rubinius/blob/d17c1294e09ab9c70495a1278450c09e38ed01c6/kernel/common/symbol.rb#L108-L120) (which looks like [sym_call in MRI](https://github.com/ruby/ruby/blob/800c7af73ccae7ef862674f682d1d82ba2149379/string.c#L8455-L8505)).\r\n\r\n--\r\nSorry this PR does not have a test (I don't know where to add). Simple example:\r\n\r\n```rb\r\n[[1,2],[3,4]].map(&:last)  #=> should be [2,4]\r\n```\r\n\r\nMore complex example (calling block with block):\r\n\r\n```rb\r\nclass Foo\r\n  def bar(a, &b)\r\n    b.call(a)\r\n  end\r\nend\r\n\r\ndef test(&block)\r\n  block.call(Foo.new, 1){|x| puts \"I got #{x}\" }\r\nend\r\n\r\ntest(&:bar) #=> should be \"I got 1\"\r\n```\r\n","created_at":"2014-06-16T08:18:24Z","updated_at":"2014-08-25T21:06:59Z","closed_at":"2014-08-25T21:06:59Z","merged_at":"2014-08-25T21:06:59Z","merge_commit_sha":"03db639b36c547534bfd6542b9ab6803606be4ea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opal/opal/pulls/551/commits","review_comments_url":"https://api.github.com/repos/opal/opal/pulls/551/comments","review_comment_url":"https://api.github.com/repos/opal/opal/pulls/comments/{number}","comments_url":"https://api.github.com/repos/opal/opal/issues/551/comments","statuses_url":"https://api.github.com/repos/opal/opal/statuses/be1578998f0b4211bee583f77c8bd359fd822e79","head":{"label":"yhara:fix_to_proc","ref":"fix_to_proc","sha":"be1578998f0b4211bee583f77c8bd359fd822e79","user":{"login":"yhara","id":12285,"avatar_url":"https://avatars.githubusercontent.com/u/12285?v=2","gravatar_id":"22270b6a4e909f6b926fa272596d41b9","url":"https://api.github.com/users/yhara","html_url":"https://github.com/yhara","followers_url":"https://api.github.com/users/yhara/followers","following_url":"https://api.github.com/users/yhara/following{/other_user}","gists_url":"https://api.github.com/users/yhara/gists{/gist_id}","starred_url":"https://api.github.com/users/yhara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhara/subscriptions","organizations_url":"https://api.github.com/users/yhara/orgs","repos_url":"https://api.github.com/users/yhara/repos","events_url":"https://api.github.com/users/yhara/events{/privacy}","received_events_url":"https://api.github.com/users/yhara/received_events","type":"User","site_admin":false},"repo":{"id":14036681,"name":"opal","full_name":"yhara/opal","owner":{"login":"yhara","id":12285,"avatar_url":"https://avatars.githubusercontent.com/u/12285?v=2","gravatar_id":"22270b6a4e909f6b926fa272596d41b9","url":"https://api.github.com/users/yhara","html_url":"https://github.com/yhara","followers_url":"https://api.github.com/users/yhara/followers","following_url":"https://api.github.com/users/yhara/following{/other_user}","gists_url":"https://api.github.com/users/yhara/gists{/gist_id}","starred_url":"https://api.github.com/users/yhara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yhara/subscriptions","organizations_url":"https://api.github.com/users/yhara/orgs","repos_url":"https://api.github.com/users/yhara/repos","events_url":"https://api.github.com/users/yhara/events{/privacy}","received_events_url":"https://api.github.com/users/yhara/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yhara/opal","description":"Ruby to Javascript compiler","fork":true,"url":"https://api.github.com/repos/yhara/opal","forks_url":"https://api.github.com/repos/yhara/opal/forks","keys_url":"https://api.github.com/repos/yhara/opal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yhara/opal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yhara/opal/teams","hooks_url":"https://api.github.com/repos/yhara/opal/hooks","issue_events_url":"https://api.github.com/repos/yhara/opal/issues/events{/number}","events_url":"https://api.github.com/repos/yhara/opal/events","assignees_url":"https://api.github.com/repos/yhara/opal/assignees{/user}","branches_url":"https://api.github.com/repos/yhara/opal/branches{/branch}","tags_url":"https://api.github.com/repos/yhara/opal/tags","blobs_url":"https://api.github.com/repos/yhara/opal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yhara/opal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yhara/opal/git/refs{/sha}","trees_url":"https://api.github.com/repos/yhara/opal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yhara/opal/statuses/{sha}","languages_url":"https://api.github.com/repos/yhara/opal/languages","stargazers_url":"https://api.github.com/repos/yhara/opal/stargazers","contributors_url":"https://api.github.com/repos/yhara/opal/contributors","subscribers_url":"https://api.github.com/repos/yhara/opal/subscribers","subscription_url":"https://api.github.com/repos/yhara/opal/subscription","commits_url":"https://api.github.com/repos/yhara/opal/commits{/sha}","git_commits_url":"https://api.github.com/repos/yhara/opal/git/commits{/sha}","comments_url":"https://api.github.com/repos/yhara/opal/comments{/number}","issue_comment_url":"https://api.github.com/repos/yhara/opal/issues/comments/{number}","contents_url":"https://api.github.com/repos/yhara/opal/contents/{+path}","compare_url":"https://api.github.com/repos/yhara/opal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yhara/opal/merges","archive_url":"https://api.github.com/repos/yhara/opal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yhara/opal/downloads","issues_url":"https://api.github.com/repos/yhara/opal/issues{/number}","pulls_url":"https://api.github.com/repos/yhara/opal/pulls{/number}","milestones_url":"https://api.github.com/repos/yhara/opal/milestones{/number}","notifications_url":"https://api.github.com/repos/yhara/opal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yhara/opal/labels{/name}","releases_url":"https://api.github.com/repos/yhara/opal/releases{/id}","created_at":"2013-11-01T05:56:01Z","updated_at":"2014-06-16T09:21:26Z","pushed_at":"2014-06-16T09:21:26Z","git_url":"git://github.com/yhara/opal.git","ssh_url":"git@github.com:yhara/opal.git","clone_url":"https://github.com/yhara/opal.git","svn_url":"https://github.com/yhara/opal","homepage":"http://opalrb.org","size":6394,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"opal:master","ref":"master","sha":"011960a3e951aaf6b2dd76c2c009201628b45486","user":{"login":"opal","id":842643,"avatar_url":"https://avatars.githubusercontent.com/u/842643?v=2","gravatar_id":"88298620949a6534d403da2e356c9339","url":"https://api.github.com/users/opal","html_url":"https://github.com/opal","followers_url":"https://api.github.com/users/opal/followers","following_url":"https://api.github.com/users/opal/following{/other_user}","gists_url":"https://api.github.com/users/opal/gists{/gist_id}","starred_url":"https://api.github.com/users/opal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opal/subscriptions","organizations_url":"https://api.github.com/users/opal/orgs","repos_url":"https://api.github.com/users/opal/repos","events_url":"https://api.github.com/users/opal/events{/privacy}","received_events_url":"https://api.github.com/users/opal/received_events","type":"Organization","site_admin":false},"repo":{"id":184366,"name":"opal","full_name":"opal/opal","owner":{"login":"opal","id":842643,"avatar_url":"https://avatars.githubusercontent.com/u/842643?v=2","gravatar_id":"88298620949a6534d403da2e356c9339","url":"https://api.github.com/users/opal","html_url":"https://github.com/opal","followers_url":"https://api.github.com/users/opal/followers","following_url":"https://api.github.com/users/opal/following{/other_user}","gists_url":"https://api.github.com/users/opal/gists{/gist_id}","starred_url":"https://api.github.com/users/opal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opal/subscriptions","organizations_url":"https://api.github.com/users/opal/orgs","repos_url":"https://api.github.com/users/opal/repos","events_url":"https://api.github.com/users/opal/events{/privacy}","received_events_url":"https://api.github.com/users/opal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opal/opal","description":"Ruby to Javascript compiler","fork":false,"url":"https://api.github.com/repos/opal/opal","forks_url":"https://api.github.com/repos/opal/opal/forks","keys_url":"https://api.github.com/repos/opal/opal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opal/opal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opal/opal/teams","hooks_url":"https://api.github.com/repos/opal/opal/hooks","issue_events_url":"https://api.github.com/repos/opal/opal/issues/events{/number}","events_url":"https://api.github.com/repos/opal/opal/events","assignees_url":"https://api.github.com/repos/opal/opal/assignees{/user}","branches_url":"https://api.github.com/repos/opal/opal/branches{/branch}","tags_url":"https://api.github.com/repos/opal/opal/tags","blobs_url":"https://api.github.com/repos/opal/opal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opal/opal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opal/opal/git/refs{/sha}","trees_url":"https://api.github.com/repos/opal/opal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opal/opal/statuses/{sha}","languages_url":"https://api.github.com/repos/opal/opal/languages","stargazers_url":"https://api.github.com/repos/opal/opal/stargazers","contributors_url":"https://api.github.com/repos/opal/opal/contributors","subscribers_url":"https://api.github.com/repos/opal/opal/subscribers","subscription_url":"https://api.github.com/repos/opal/opal/subscription","commits_url":"https://api.github.com/repos/opal/opal/commits{/sha}","git_commits_url":"https://api.github.com/repos/opal/opal/git/commits{/sha}","comments_url":"https://api.github.com/repos/opal/opal/comments{/number}","issue_comment_url":"https://api.github.com/repos/opal/opal/issues/comments/{number}","contents_url":"https://api.github.com/repos/opal/opal/contents/{+path}","compare_url":"https://api.github.com/repos/opal/opal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opal/opal/merges","archive_url":"https://api.github.com/repos/opal/opal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opal/opal/downloads","issues_url":"https://api.github.com/repos/opal/opal/issues{/number}","pulls_url":"https://api.github.com/repos/opal/opal/pulls{/number}","milestones_url":"https://api.github.com/repos/opal/opal/milestones{/number}","notifications_url":"https://api.github.com/repos/opal/opal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opal/opal/labels{/name}","releases_url":"https://api.github.com/repos/opal/opal/releases{/id}","created_at":"2009-04-24T08:53:34Z","updated_at":"2014-08-25T09:31:10Z","pushed_at":"2014-08-25T21:06:59Z","git_url":"git://github.com/opal/opal.git","ssh_url":"git@github.com:opal/opal.git","clone_url":"https://github.com/opal/opal.git","svn_url":"https://github.com/opal/opal","homepage":"http://opalrb.org","size":16556,"stargazers_count":1812,"watchers_count":1812,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"forks_count":112,"mirror_url":null,"open_issues_count":68,"forks":112,"open_issues":68,"watchers":1812,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opal/opal/pulls/551"},"html":{"href":"https://github.com/opal/opal/pull/551"},"issue":{"href":"https://api.github.com/repos/opal/opal/issues/551"},"comments":{"href":"https://api.github.com/repos/opal/opal/issues/551/comments"},"review_comments":{"href":"https://api.github.com/repos/opal/opal/pulls/551/comments"},"review_comment":{"href":"https://api.github.com/repos/opal/opal/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/opal/opal/pulls/551/commits"},"statuses":{"href":"https://api.github.com/repos/opal/opal/statuses/be1578998f0b4211bee583f77c8bd359fd822e79"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"meh","id":40204,"avatar_url":"https://avatars.githubusercontent.com/u/40204?v=2","gravatar_id":"ae800940630609c233d0cfb8929b30f1","url":"https://api.github.com/users/meh","html_url":"https://github.com/meh","followers_url":"https://api.github.com/users/meh/followers","following_url":"https://api.github.com/users/meh/following{/other_user}","gists_url":"https://api.github.com/users/meh/gists{/gist_id}","starred_url":"https://api.github.com/users/meh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meh/subscriptions","organizations_url":"https://api.github.com/users/meh/orgs","repos_url":"https://api.github.com/users/meh/repos","events_url":"https://api.github.com/users/meh/events{/privacy}","received_events_url":"https://api.github.com/users/meh/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":2,"additions":7,"deletions":7,"changed_files":2}}