{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/44782818","id":44782818,"diff_hunk":"@@ -55,10 +55,12 @@ def changed?(name)\n     # Load a single plugin by name.  We use 'load' here so we can reload a\n     # given plugin.\n     def load_file(name, env)\n+      load_path = $LOAD_PATH\n       file = get_file(name.to_s, env)\n       return false unless file\n       begin\n         mark_loaded(name, file)\n+        $LOAD_PATH.push *(search_directories(env))","path":"lib/puppet/util/autoload.rb","position":9,"original_position":9,"commit_id":"0f1cfa2d62b8a16687bb5a81276ca687dff6844f","original_commit_id":"0f1cfa2d62b8a16687bb5a81276ca687dff6844f","user":{"login":"hlindberg","id":563066,"avatar_url":"https://avatars.githubusercontent.com/u/563066?v=3","gravatar_id":"","url":"https://api.github.com/users/hlindberg","html_url":"https://github.com/hlindberg","followers_url":"https://api.github.com/users/hlindberg/followers","following_url":"https://api.github.com/users/hlindberg/following{/other_user}","gists_url":"https://api.github.com/users/hlindberg/gists{/gist_id}","starred_url":"https://api.github.com/users/hlindberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlindberg/subscriptions","organizations_url":"https://api.github.com/users/hlindberg/orgs","repos_url":"https://api.github.com/users/hlindberg/repos","events_url":"https://api.github.com/users/hlindberg/events{/privacy}","received_events_url":"https://api.github.com/users/hlindberg/received_events","type":"User","site_admin":false},"body":"`search_directories` will include everything already on the `$LOAD_PATH` since its definition is `[gem_directories, module_directories(env), libdirs(), $LOAD_PATH].flatten`. I think the result is lots of extra entries on the path. This has performance implications as it will search through all of them.","created_at":"2015-11-13T13:44:09Z","updated_at":"2015-11-13T13:44:09Z","html_url":"https://github.com/puppetlabs/puppet/pull/4445#discussion_r44782818","pull_request_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/4445","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments/44782818"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/4445#discussion_r44782818"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/4445"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/puppet/pulls/4445","id":50632101,"html_url":"https://github.com/puppetlabs/puppet/pull/4445","diff_url":"https://github.com/puppetlabs/puppet/pull/4445.diff","patch_url":"https://github.com/puppetlabs/puppet/pull/4445.patch","issue_url":"https://api.github.com/repos/puppetlabs/puppet/issues/4445","number":4445,"state":"open","locked":false,"title":"Fix up LOAD_PATH before calling Kernel.load","user":{"login":"njm506","id":5664451,"avatar_url":"https://avatars.githubusercontent.com/u/5664451?v=3","gravatar_id":"","url":"https://api.github.com/users/njm506","html_url":"https://github.com/njm506","followers_url":"https://api.github.com/users/njm506/followers","following_url":"https://api.github.com/users/njm506/following{/other_user}","gists_url":"https://api.github.com/users/njm506/gists{/gist_id}","starred_url":"https://api.github.com/users/njm506/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njm506/subscriptions","organizations_url":"https://api.github.com/users/njm506/orgs","repos_url":"https://api.github.com/users/njm506/repos","events_url":"https://api.github.com/users/njm506/events{/privacy}","received_events_url":"https://api.github.com/users/njm506/received_events","type":"User","site_admin":false},"body":"(PUP-4450) Sometimes, we're autoloading something that _require_s a library that lives in a directory which Puppet knows about, but the Ruby kernel doesn't.\r\n\r\nI've compared spec results; this change makes no difference to them.\r\n\r\nThis change should be portable to Puppet 4; we've only tested it Puppet 3, though.","created_at":"2015-11-13T11:44:41Z","updated_at":"2015-11-13T13:44:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"037740df7e929a6d3293297a664016c09e75ab9a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/4445/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/4445/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/issues/4445/comments","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/0f1cfa2d62b8a16687bb5a81276ca687dff6844f","head":{"label":"njm506:3.x","ref":"3.x","sha":"0f1cfa2d62b8a16687bb5a81276ca687dff6844f","user":{"login":"njm506","id":5664451,"avatar_url":"https://avatars.githubusercontent.com/u/5664451?v=3","gravatar_id":"","url":"https://api.github.com/users/njm506","html_url":"https://github.com/njm506","followers_url":"https://api.github.com/users/njm506/followers","following_url":"https://api.github.com/users/njm506/following{/other_user}","gists_url":"https://api.github.com/users/njm506/gists{/gist_id}","starred_url":"https://api.github.com/users/njm506/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njm506/subscriptions","organizations_url":"https://api.github.com/users/njm506/orgs","repos_url":"https://api.github.com/users/njm506/repos","events_url":"https://api.github.com/users/njm506/events{/privacy}","received_events_url":"https://api.github.com/users/njm506/received_events","type":"User","site_admin":false},"repo":{"id":46116958,"name":"puppet","full_name":"njm506/puppet","owner":{"login":"njm506","id":5664451,"avatar_url":"https://avatars.githubusercontent.com/u/5664451?v=3","gravatar_id":"","url":"https://api.github.com/users/njm506","html_url":"https://github.com/njm506","followers_url":"https://api.github.com/users/njm506/followers","following_url":"https://api.github.com/users/njm506/following{/other_user}","gists_url":"https://api.github.com/users/njm506/gists{/gist_id}","starred_url":"https://api.github.com/users/njm506/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njm506/subscriptions","organizations_url":"https://api.github.com/users/njm506/orgs","repos_url":"https://api.github.com/users/njm506/repos","events_url":"https://api.github.com/users/njm506/events{/privacy}","received_events_url":"https://api.github.com/users/njm506/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/njm506/puppet","description":"Server automation framework and application","fork":true,"url":"https://api.github.com/repos/njm506/puppet","forks_url":"https://api.github.com/repos/njm506/puppet/forks","keys_url":"https://api.github.com/repos/njm506/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/njm506/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/njm506/puppet/teams","hooks_url":"https://api.github.com/repos/njm506/puppet/hooks","issue_events_url":"https://api.github.com/repos/njm506/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/njm506/puppet/events","assignees_url":"https://api.github.com/repos/njm506/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/njm506/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/njm506/puppet/tags","blobs_url":"https://api.github.com/repos/njm506/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/njm506/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/njm506/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/njm506/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/njm506/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/njm506/puppet/languages","stargazers_url":"https://api.github.com/repos/njm506/puppet/stargazers","contributors_url":"https://api.github.com/repos/njm506/puppet/contributors","subscribers_url":"https://api.github.com/repos/njm506/puppet/subscribers","subscription_url":"https://api.github.com/repos/njm506/puppet/subscription","commits_url":"https://api.github.com/repos/njm506/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/njm506/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/njm506/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/njm506/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/njm506/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/njm506/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/njm506/puppet/merges","archive_url":"https://api.github.com/repos/njm506/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/njm506/puppet/downloads","issues_url":"https://api.github.com/repos/njm506/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/njm506/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/njm506/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/njm506/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/njm506/puppet/labels{/name}","releases_url":"https://api.github.com/repos/njm506/puppet/releases{/id}","created_at":"2015-11-13T10:58:25Z","updated_at":"2015-11-13T10:58:38Z","pushed_at":"2015-11-13T11:07:46Z","git_url":"git://github.com/njm506/puppet.git","ssh_url":"git@github.com:njm506/puppet.git","clone_url":"https://github.com/njm506/puppet.git","svn_url":"https://github.com/njm506/puppet","homepage":"https://puppetlabs.com/puppet/what-is-puppet","size":141111,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:3.x","ref":"3.x","sha":"b1990afa77800597acbdc683500f8b61e0caaa68","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":910744,"name":"puppet","full_name":"puppetlabs/puppet","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/puppet","description":"Server automation framework and application","fork":false,"url":"https://api.github.com/repos/puppetlabs/puppet","forks_url":"https://api.github.com/repos/puppetlabs/puppet/forks","keys_url":"https://api.github.com/repos/puppetlabs/puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/puppet/teams","hooks_url":"https://api.github.com/repos/puppetlabs/puppet/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/puppet/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/puppet/events","assignees_url":"https://api.github.com/repos/puppetlabs/puppet/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/puppet/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/puppet/tags","blobs_url":"https://api.github.com/repos/puppetlabs/puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/puppet/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/puppet/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/puppet/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/puppet/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/puppet/subscription","commits_url":"https://api.github.com/repos/puppetlabs/puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/puppet/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/puppet/merges","archive_url":"https://api.github.com/repos/puppetlabs/puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/puppet/downloads","issues_url":"https://api.github.com/repos/puppetlabs/puppet/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/puppet/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/puppet/releases{/id}","created_at":"2010-09-14T19:26:44Z","updated_at":"2015-11-13T07:38:26Z","pushed_at":"2015-11-13T11:44:41Z","git_url":"git://github.com/puppetlabs/puppet.git","ssh_url":"git@github.com:puppetlabs/puppet.git","clone_url":"https://github.com/puppetlabs/puppet.git","svn_url":"https://github.com/puppetlabs/puppet","homepage":"https://puppetlabs.com/puppet/what-is-puppet","size":141111,"stargazers_count":3644,"watchers_count":3644,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1517,"mirror_url":null,"open_issues_count":30,"forks":1517,"open_issues":30,"watchers":3644,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/4445"},"html":{"href":"https://github.com/puppetlabs/puppet/pull/4445"},"issue":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/4445"},"comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/issues/4445/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/4445/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/puppet/pulls/4445/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/puppet/statuses/0f1cfa2d62b8a16687bb5a81276ca687dff6844f"}}}}