{"action":"created","issue":{"url":"https://api.github.com/repos/chef/ohai/issues/520","labels_url":"https://api.github.com/repos/chef/ohai/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/chef/ohai/issues/520/comments","events_url":"https://api.github.com/repos/chef/ohai/issues/520/events","html_url":"https://github.com/chef/ohai/issues/520","id":66715112,"number":520,"title":"ohai & $load_path","user":{"login":"svmastersamurai","id":680210,"avatar_url":"https://avatars.githubusercontent.com/u/680210?v=3","gravatar_id":"","url":"https://api.github.com/users/svmastersamurai","html_url":"https://github.com/svmastersamurai","followers_url":"https://api.github.com/users/svmastersamurai/followers","following_url":"https://api.github.com/users/svmastersamurai/following{/other_user}","gists_url":"https://api.github.com/users/svmastersamurai/gists{/gist_id}","starred_url":"https://api.github.com/users/svmastersamurai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svmastersamurai/subscriptions","organizations_url":"https://api.github.com/users/svmastersamurai/orgs","repos_url":"https://api.github.com/users/svmastersamurai/repos","events_url":"https://api.github.com/users/svmastersamurai/events{/privacy}","received_events_url":"https://api.github.com/users/svmastersamurai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-06T21:57:58Z","updated_at":"2015-08-18T21:52:10Z","closed_at":null,"body":"I'm trying to collect some information about the system via an ohai plugin I've written. The plugin utilizes some custom ruby classes I've developed to make things more modular. To get this to work I have a cookbook that will append to the $LOAD_PATH so it can find the classes I've written. This works when plugins are reloaded, but does not work on subsequent runs. Rather than having to reload all the plugins every chef run I am curious how to get ohai to see my custom classes without needing to reload plugins every time. I've also tried to set the local ruby environment variables RUBYLIB and RUBYLIB_PREFIX within a cookbook but to no avail =(\r\n\r\nIdeally I would like to collect information like this\r\n```\r\nrequire 'my_custom_information_collector'\r\n\r\nOhai.plugin(:default) do\r\n  provides 'custom_info'\r\n   collect_data do\r\n    my_node['custom_info'] = my_custom_information_collector.new.get_some_info\r\n  end\r\nend\r\n```\r\n\r\nThere of course is the argument to have the classes located within the plugin, which is how I was previously doing things. However, I want to be able to abstract things out and allow this library to support multiple platforms, of which I will have different members on my team contribute code to their respective operating system that they know best. Given this requirement, a particular plugin file could grow to a large size and be difficult to follow since as we expand support to more platforms. \r\n\r\nIs this a supported use case? Would a custom gem be a better alternative than appending to the $LOAD_PATH during runtime? If so, would what would be a good way to vendor this gem?\r\n\r\nCheers!"},"comment":{"url":"https://api.github.com/repos/chef/ohai/issues/comments/132367177","html_url":"https://github.com/chef/ohai/issues/520#issuecomment-132367177","issue_url":"https://api.github.com/repos/chef/ohai/issues/520","id":132367177,"user":{"login":"svmastersamurai","id":680210,"avatar_url":"https://avatars.githubusercontent.com/u/680210?v=3","gravatar_id":"","url":"https://api.github.com/users/svmastersamurai","html_url":"https://github.com/svmastersamurai","followers_url":"https://api.github.com/users/svmastersamurai/followers","following_url":"https://api.github.com/users/svmastersamurai/following{/other_user}","gists_url":"https://api.github.com/users/svmastersamurai/gists{/gist_id}","starred_url":"https://api.github.com/users/svmastersamurai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svmastersamurai/subscriptions","organizations_url":"https://api.github.com/users/svmastersamurai/orgs","repos_url":"https://api.github.com/users/svmastersamurai/repos","events_url":"https://api.github.com/users/svmastersamurai/events{/privacy}","received_events_url":"https://api.github.com/users/svmastersamurai/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T21:52:10Z","updated_at":"2015-08-18T21:52:10Z","body":"Not a problem @mcquin, currently I am going through some training at work and will be away from my chef duties for a few more weeks, but I will give this a try and update this as soon as I can take a look at it!"}}