{"action":"opened","number":5494,"pull_request":{"url":"https://api.github.com/repos/jruby/jruby/pulls/5494","id":235569302,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NTY5MzAy","html_url":"https://github.com/jruby/jruby/pull/5494","diff_url":"https://github.com/jruby/jruby/pull/5494.diff","patch_url":"https://github.com/jruby/jruby/pull/5494.patch","issue_url":"https://api.github.com/repos/jruby/jruby/issues/5494","number":5494,"state":"open","locked":false,"title":"Ruby 2.6: Add #to_h with block argument to Array, Enum, ENV, Hash and Struct","user":{"login":"nomadium","id":79817,"node_id":"MDQ6VXNlcjc5ODE3","avatar_url":"https://avatars2.githubusercontent.com/u/79817?v=4","gravatar_id":"","url":"https://api.github.com/users/nomadium","html_url":"https://github.com/nomadium","followers_url":"https://api.github.com/users/nomadium/followers","following_url":"https://api.github.com/users/nomadium/following{/other_user}","gists_url":"https://api.github.com/users/nomadium/gists{/gist_id}","starred_url":"https://api.github.com/users/nomadium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomadium/subscriptions","organizations_url":"https://api.github.com/users/nomadium/orgs","repos_url":"https://api.github.com/users/nomadium/repos","events_url":"https://api.github.com/users/nomadium/events{/privacy}","received_events_url":"https://api.github.com/users/nomadium/received_events","type":"User","site_admin":false},"body":"Hi folks,\r\n\r\nThis PR implements another Ruby 2.6 feature: #to_h method in Array, Enumerable, ENV, Hash and Struct classes now can map their elements to new keys and values to a given block.\r\n\r\nFor more information, please see feature #15143 [1].\r\n\r\nI believe all the related tests (MRI and ruby/spec) are passing:i [2], [3], [4], [5], [6], [7], [8], [9], [10], [11].\r\n\r\nFor reference, I include a link to the commit introducing the functionality in MRI. [12]\r\n\r\nThanks in advance for any feedback.\r\n\r\n 1. https://bugs.ruby-lang.org/issues/15143\r\n 2. https://github.com/ruby/ruby/blob/v2_6_0_preview3/spec/ruby/core/array/to_h_spec.rb#L38-L41\r\n 3. https://github.com/ruby/ruby/blob/v2_6_0_preview3/spec/ruby/core/enumerable/to_h_spec.rb#L47-L53\r\n 4. https://github.com/ruby/ruby/blob/v2_6_0_preview3/spec/ruby/core/env/to_h_spec.rb#L7-L17\r\n 5. https://github.com/ruby/ruby/blob/v2_6_0_preview3/spec/ruby/core/hash/to_h_spec.rb#L10-L14\r\n 6. https://github.com/ruby/ruby/blob/v2_6_0_preview3/spec/ruby/core/struct/to_h_spec.rb#L16-L22\r\n 7. https://github.com/ruby/ruby/blob/v2_6_0_preview3/test/ruby/test_array.rb#L1634-L1653\r\n 8. https://github.com/ruby/ruby/blob/v2_6_0_preview3/test/ruby/test_enum.rb#L183-L202\r\n 9. https://github.com/ruby/ruby/blob/v2_6_0_preview3/test/ruby/test_env.rb#L400-L404\r\n10. https://github.com/ruby/ruby/blob/v2_6_0_preview3/test/ruby/test_hash.rb#L868-L876\r\n11. https://github.com/ruby/ruby/blob/v2_6_0_preview3/test/ruby/test_struct.rb#L365-L370\r\n12. https://github.com/ruby/ruby/commit/abe75149d14d3286d3051c9e961ab6473a243a19\r\n","created_at":"2018-12-03T19:44:49Z","updated_at":"2018-12-03T19:44:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jruby/jruby/pulls/5494/commits","review_comments_url":"https://api.github.com/repos/jruby/jruby/pulls/5494/comments","review_comment_url":"https://api.github.com/repos/jruby/jruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jruby/jruby/issues/5494/comments","statuses_url":"https://api.github.com/repos/jruby/jruby/statuses/6555e0656221ca978d3634db4a30e8a3a2106e55","head":{"label":"nomadium:ruby-2.6-add-to_h-with-block-to-array-enum-env-hash-and-struct","ref":"ruby-2.6-add-to_h-with-block-to-array-enum-env-hash-and-struct","sha":"6555e0656221ca978d3634db4a30e8a3a2106e55","user":{"login":"nomadium","id":79817,"node_id":"MDQ6VXNlcjc5ODE3","avatar_url":"https://avatars2.githubusercontent.com/u/79817?v=4","gravatar_id":"","url":"https://api.github.com/users/nomadium","html_url":"https://github.com/nomadium","followers_url":"https://api.github.com/users/nomadium/followers","following_url":"https://api.github.com/users/nomadium/following{/other_user}","gists_url":"https://api.github.com/users/nomadium/gists{/gist_id}","starred_url":"https://api.github.com/users/nomadium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomadium/subscriptions","organizations_url":"https://api.github.com/users/nomadium/orgs","repos_url":"https://api.github.com/users/nomadium/repos","events_url":"https://api.github.com/users/nomadium/events{/privacy}","received_events_url":"https://api.github.com/users/nomadium/received_events","type":"User","site_admin":false},"repo":{"id":111018052,"node_id":"MDEwOlJlcG9zaXRvcnkxMTEwMTgwNTI=","name":"jruby","full_name":"nomadium/jruby","private":false,"owner":{"login":"nomadium","id":79817,"node_id":"MDQ6VXNlcjc5ODE3","avatar_url":"https://avatars2.githubusercontent.com/u/79817?v=4","gravatar_id":"","url":"https://api.github.com/users/nomadium","html_url":"https://github.com/nomadium","followers_url":"https://api.github.com/users/nomadium/followers","following_url":"https://api.github.com/users/nomadium/following{/other_user}","gists_url":"https://api.github.com/users/nomadium/gists{/gist_id}","starred_url":"https://api.github.com/users/nomadium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomadium/subscriptions","organizations_url":"https://api.github.com/users/nomadium/orgs","repos_url":"https://api.github.com/users/nomadium/repos","events_url":"https://api.github.com/users/nomadium/events{/privacy}","received_events_url":"https://api.github.com/users/nomadium/received_events","type":"User","site_admin":false},"html_url":"https://github.com/nomadium/jruby","description":"JRuby, an implementation of Ruby on the JVM","fork":true,"url":"https://api.github.com/repos/nomadium/jruby","forks_url":"https://api.github.com/repos/nomadium/jruby/forks","keys_url":"https://api.github.com/repos/nomadium/jruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nomadium/jruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nomadium/jruby/teams","hooks_url":"https://api.github.com/repos/nomadium/jruby/hooks","issue_events_url":"https://api.github.com/repos/nomadium/jruby/issues/events{/number}","events_url":"https://api.github.com/repos/nomadium/jruby/events","assignees_url":"https://api.github.com/repos/nomadium/jruby/assignees{/user}","branches_url":"https://api.github.com/repos/nomadium/jruby/branches{/branch}","tags_url":"https://api.github.com/repos/nomadium/jruby/tags","blobs_url":"https://api.github.com/repos/nomadium/jruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nomadium/jruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nomadium/jruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/nomadium/jruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nomadium/jruby/statuses/{sha}","languages_url":"https://api.github.com/repos/nomadium/jruby/languages","stargazers_url":"https://api.github.com/repos/nomadium/jruby/stargazers","contributors_url":"https://api.github.com/repos/nomadium/jruby/contributors","subscribers_url":"https://api.github.com/repos/nomadium/jruby/subscribers","subscription_url":"https://api.github.com/repos/nomadium/jruby/subscription","commits_url":"https://api.github.com/repos/nomadium/jruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/nomadium/jruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/nomadium/jruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/nomadium/jruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/nomadium/jruby/contents/{+path}","compare_url":"https://api.github.com/repos/nomadium/jruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nomadium/jruby/merges","archive_url":"https://api.github.com/repos/nomadium/jruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nomadium/jruby/downloads","issues_url":"https://api.github.com/repos/nomadium/jruby/issues{/number}","pulls_url":"https://api.github.com/repos/nomadium/jruby/pulls{/number}","milestones_url":"https://api.github.com/repos/nomadium/jruby/milestones{/number}","notifications_url":"https://api.github.com/repos/nomadium/jruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nomadium/jruby/labels{/name}","releases_url":"https://api.github.com/repos/nomadium/jruby/releases{/id}","deployments_url":"https://api.github.com/repos/nomadium/jruby/deployments","created_at":"2017-11-16T20:20:52Z","updated_at":"2018-12-02T19:20:23Z","pushed_at":"2018-12-03T19:36:24Z","git_url":"git://github.com/nomadium/jruby.git","ssh_url":"git@github.com:nomadium/jruby.git","clone_url":"https://github.com/nomadium/jruby.git","svn_url":"https://github.com/nomadium/jruby","homepage":"http://www.jruby.org","size":225356,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jruby:ruby-2.6","ref":"ruby-2.6","sha":"396a0bf9cf713fc23e9f0047591ea1d1cf0667f8","user":{"login":"jruby","id":55687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU1Njg3","avatar_url":"https://avatars2.githubusercontent.com/u/55687?v=4","gravatar_id":"","url":"https://api.github.com/users/jruby","html_url":"https://github.com/jruby","followers_url":"https://api.github.com/users/jruby/followers","following_url":"https://api.github.com/users/jruby/following{/other_user}","gists_url":"https://api.github.com/users/jruby/gists{/gist_id}","starred_url":"https://api.github.com/users/jruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jruby/subscriptions","organizations_url":"https://api.github.com/users/jruby/orgs","repos_url":"https://api.github.com/users/jruby/repos","events_url":"https://api.github.com/users/jruby/events{/privacy}","received_events_url":"https://api.github.com/users/jruby/received_events","type":"Organization","site_admin":false},"repo":{"id":168370,"node_id":"MDEwOlJlcG9zaXRvcnkxNjgzNzA=","name":"jruby","full_name":"jruby/jruby","private":false,"owner":{"login":"jruby","id":55687,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU1Njg3","avatar_url":"https://avatars2.githubusercontent.com/u/55687?v=4","gravatar_id":"","url":"https://api.github.com/users/jruby","html_url":"https://github.com/jruby","followers_url":"https://api.github.com/users/jruby/followers","following_url":"https://api.github.com/users/jruby/following{/other_user}","gists_url":"https://api.github.com/users/jruby/gists{/gist_id}","starred_url":"https://api.github.com/users/jruby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jruby/subscriptions","organizations_url":"https://api.github.com/users/jruby/orgs","repos_url":"https://api.github.com/users/jruby/repos","events_url":"https://api.github.com/users/jruby/events{/privacy}","received_events_url":"https://api.github.com/users/jruby/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/jruby/jruby","description":"JRuby, an implementation of Ruby on the JVM","fork":false,"url":"https://api.github.com/repos/jruby/jruby","forks_url":"https://api.github.com/repos/jruby/jruby/forks","keys_url":"https://api.github.com/repos/jruby/jruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jruby/jruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jruby/jruby/teams","hooks_url":"https://api.github.com/repos/jruby/jruby/hooks","issue_events_url":"https://api.github.com/repos/jruby/jruby/issues/events{/number}","events_url":"https://api.github.com/repos/jruby/jruby/events","assignees_url":"https://api.github.com/repos/jruby/jruby/assignees{/user}","branches_url":"https://api.github.com/repos/jruby/jruby/branches{/branch}","tags_url":"https://api.github.com/repos/jruby/jruby/tags","blobs_url":"https://api.github.com/repos/jruby/jruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jruby/jruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jruby/jruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/jruby/jruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jruby/jruby/statuses/{sha}","languages_url":"https://api.github.com/repos/jruby/jruby/languages","stargazers_url":"https://api.github.com/repos/jruby/jruby/stargazers","contributors_url":"https://api.github.com/repos/jruby/jruby/contributors","subscribers_url":"https://api.github.com/repos/jruby/jruby/subscribers","subscription_url":"https://api.github.com/repos/jruby/jruby/subscription","commits_url":"https://api.github.com/repos/jruby/jruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/jruby/jruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/jruby/jruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/jruby/jruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/jruby/jruby/contents/{+path}","compare_url":"https://api.github.com/repos/jruby/jruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jruby/jruby/merges","archive_url":"https://api.github.com/repos/jruby/jruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jruby/jruby/downloads","issues_url":"https://api.github.com/repos/jruby/jruby/issues{/number}","pulls_url":"https://api.github.com/repos/jruby/jruby/pulls{/number}","milestones_url":"https://api.github.com/repos/jruby/jruby/milestones{/number}","notifications_url":"https://api.github.com/repos/jruby/jruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jruby/jruby/labels{/name}","releases_url":"https://api.github.com/repos/jruby/jruby/releases{/id}","deployments_url":"https://api.github.com/repos/jruby/jruby/deployments","created_at":"2009-04-05T03:54:35Z","updated_at":"2018-12-03T19:29:46Z","pushed_at":"2018-12-03T19:29:36Z","git_url":"git://github.com/jruby/jruby.git","ssh_url":"git@github.com:jruby/jruby.git","clone_url":"https://github.com/jruby/jruby.git","svn_url":"https://github.com/jruby/jruby","homepage":"http://www.jruby.org","size":227414,"stargazers_count":3221,"watchers_count":3221,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":810,"mirror_url":null,"archived":false,"open_issues_count":605,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":810,"open_issues":605,"watchers":3221,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jruby/jruby/pulls/5494"},"html":{"href":"https://github.com/jruby/jruby/pull/5494"},"issue":{"href":"https://api.github.com/repos/jruby/jruby/issues/5494"},"comments":{"href":"https://api.github.com/repos/jruby/jruby/issues/5494/comments"},"review_comments":{"href":"https://api.github.com/repos/jruby/jruby/pulls/5494/comments"},"review_comment":{"href":"https://api.github.com/repos/jruby/jruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jruby/jruby/pulls/5494/commits"},"statuses":{"href":"https://api.github.com/repos/jruby/jruby/statuses/6555e0656221ca978d3634db4a30e8a3a2106e55"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":4,"additions":81,"deletions":18,"changed_files":5}}
{"actor":{"display_login":"nomadium"}}