Right. So the specs are sort of "out of date" with this push. I made the change to specify the plugin name for my first commit when I was working on the new plugin data map, but haven't updated the spec tests since. Now the loader (loader.rb) handles this kind of thing, but you still give the loader a plugin name: instead of Ohai::System.require_plugin("plugin"), you use Ohai::Loader.load_plugin("plugin"). I kept this design in because until we load all the plugins, we don't know where an attribute is defined.

Overall, though, do we want to change this to load_attribute?

From: Serdar Sutay <notifications@github.com<mailto:notifications@github.com>>
Reply-To: opscode/ohai <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Tuesday, July 30, 2013 7:17 AM
To: opscode/ohai <ohai@noreply.github.com<mailto:ohai@noreply.github.com>>
Cc: Claire McQuin <claire@opscode.com<mailto:claire@opscode.com>>
Subject: Re: [ohai] WIP: Introduction of new DSL for OHAI (#166)


In spec/unit/plugins/lua_spec.rb:

> @@ -23,7 +23,7 @@
>
>    before(:each) do
>      @ohai = Ohai::System.new
> -    @plugin = Ohai::DSL::Plugin.new(@ohai, File.join(PLUGIN_PATH, "lua.rb"))
> +    @plugin = Ohai::DSL::Plugin.new(@ohai, "lua", File.join(PLUGIN_PATH, "lua.rb"))


So in the new system, since users are interfacing with OHAI using attribute names plugin names are not that important. Maybe we can internally set the plugin name to the filename (+ some GUID in order to prevent collisions) and don't expect the clients to specify them...

Makes sense?

-
Reply to this email directly or view it on GitHub<https://github.com/opscode/ohai/pull/166/files#r5477574>.