You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Chef nexus cookbook, which manages Nexus configuration and is using nexus-cli gem under the curtains.Everything works well on Chef 11 with Ruby 1.9.3
However when running cookbook and gem on Chef 12 with Ruby 2.3, the previously working functionality gets broken due to incorrect Array argument expand when it is passed to the method via splat ( *) parameter.
The problem is coming from the fact, that extlib gem usage adds to_hash method to the Array class here, which results in incorrect keyword argument expand on Ruby 2.3 - more info about keyword arguments
# call method, which is using keyword arguments:defmanage_groupshell_out_compact!("groupmod",set_options)modify_group_membersend# definitions of the shell_out methoddefshell_out_compact!(*args, **options)ifoptions.empty?shell_out!(*clean_array(*args))elseshell_out!(*clean_array(*args), **options)endend
So question here - is the usage of 'extlib' gem still required for nexus_cli when running it on Ruby 2.3. Can nexus_cli gem be refactored not to use it at least for Ruby 2.3+
The text was updated successfully, but these errors were encountered:
GolubevV
changed the title
Extlib gem breaks further usage of Arrays, passed as plat argument to the method with keyword arguments in Ruby 2.3
Extlib gem breaks further usage of Arrays, passed as splat argument to the method with keyword arguments in Ruby 2.3
Apr 12, 2017
I am using Chef nexus cookbook, which manages Nexus configuration and is using nexus-cli gem under the curtains.Everything works well on Chef 11 with Ruby 1.9.3
However when running cookbook and gem on Chef 12 with Ruby 2.3, the previously working functionality gets broken due to incorrect Array argument expand when it is passed to the method via splat ( *) parameter.
The problem is coming from the fact, that extlib gem usage adds to_hash method to the Array class here, which results in incorrect keyword argument expand on Ruby 2.3 - more info about keyword arguments
Here is an example from PRY:
As such, this behavior breaks functionality of Chef, for example, for group management operations which is calling shell_out_compact! method:
So question here - is the usage of 'extlib' gem still required for nexus_cli when running it on Ruby 2.3. Can nexus_cli gem be refactored not to use it at least for Ruby 2.3+
The text was updated successfully, but these errors were encountered: