lib/ruote/part/engine_participant.rb in ruote-2.2.0 vs lib/ruote/part/engine_participant.rb in ruote-2.3.0

- old
+ new

@@ -1,7 +1,7 @@ #-- -# Copyright (c) 2005-2011, John Mettraux, jmettraux@gmail.com +# Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -113,10 +113,15 @@ kl = opts['storage_class'] raise(ArgumentError.new("missing 'storage_class' parameter")) unless kl - @storage = Ruote.constantize(kl).new(opts['storage_args']) + args = opts['storage_args'] + args = args.is_a?(Hash) ? [ args ] : Array(args) + args << {} unless args.last.is_a?(Hash) + args.last['preserve_configuration'] = true + + @storage = Ruote.constantize(kl).new(*args) end def consume(workitem) wi = workitem.to_h