On Sat, Jan 22, 2011 at 1:18 PM, Luke Kanies <[email protected]> wrote:
> On Jan 21, 2011, at 22:16, Dan Bode <[email protected]> wrote: > > > Hi devs, > > > > I am experimenting with extending Puppet::Application. > > > > I have my own RUBYLIB where I want to store my puppet applications. > > > > /home/dan/lib/puppet/application/foo.rb > > > > when I export RUBYLIB=/home/dan/lib/ > > > > the puppet executable can only find my application and none of the > others: > > > > puppet apply > > Error: Unknown command apply. > > Usage: puppet command <space separated arguments> > > Available commands are: foo > > > > If I move my code to: > > > > ls /usr/lib/ruby/site_ruby/1.8/puppet/application > > > > it works perfectly, > > > > Ideally, I don't want my custom code to have to live with Puppet core. > > Is puppet actually installed on your system, or running out of ~? > What is your RUBYLIB set to before you reset it here? > empty, in this case, puppet was installed via install.rb > I usually have to set RUBYLIB to my puppet git repo, so for this, I'd > have to set it to both lib directories, rather than just replacing the > value like you're doing here. > no, that was not the problem :) I figured it out, from util/command_line.rb def available_subcommands absolute_appdir = $LOAD_PATH.collect { |x| File.join(x,'puppet','application') }.detect{ |x| File.directory?(x) } Dir[File.join(absolute_appdir, '*.rb')].map{|fn| File.basename(fn, '.rb')} end key thing to note here is "detect", it only picks the commands form the first directory in load path where it finds puppet/application/, I have a patch that I am fishing that uses select instead ticket/patch to follow: > -- > Luke Kanies | +1-615-594-8199 > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<puppet-dev%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
