Atalanta / chef-chruby

Chef Cookbook for the chruby utility
Other
29 stars 25 forks source link

support chefdk's ruby #22

Closed jtimberman closed 10 years ago

jtimberman commented 10 years ago

Support the embedded Ruby in ChefDK if it is present.

http://www.getchef.com/downloads/chef-dk/

jf647 commented 10 years ago

One side-effect of this change is that while /opt/chef/embedded still ends up in RUBIES, there appears to be no way to use it. chruby just lists the last component of the path, and chef-omnibus and chefdk both end in 'embedded':

james@depot:~$ chruby
   ruby-1.9.3-p547
 * embedded
   embedded
james@depot:~$ which ruby
/opt/chefdk/embedded/bin/ruby
james@depot:~$ chruby /opt/chef/embedded
chruby: unknown Ruby: /opt/chef/embedded
james@depot:~$ chruby embedded
james@depot:~$ which ruby
/opt/chefdk/embedded/bin/ruby
james@depot:~$

This isn't a fault of this cookbook, but rather chruby's choice to only let you select on the last component. The PR could simply stop adding /opt/chef/embedded when /opt/chefdk/embedded is present without any change in functionality (and a minor improvement in UX).

There doesn't appear to be any issue open against chruby to allow for specifying the full path to a ruby. I'm not sure if this goes against the philosophy of chruby to allow this (it would add maybe 3 lines to chruby.sh, but that's 3% code bloat. :)