From: Hans F. <fu...@us...> - 2004-06-30 14:34:18
|
Update of /cvsroot/neelix/neelix/presenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5558/presenter Modified Files: presenter.rb Log Message: Can delete ingredients. Still working on proper add ingredient. It adds now, but just to the end of the list. I'd like it to add to after the current item. More important would be allowing reordering, then adding to the end isn't such a big deal. Both require the swapping idiom which is currently broken I think. See the bug on the bug tracker. http://sourceforge.net/tracker/index.php?func=detail&aid=982778&group_id=93954&atid=606159 Index: presenter.rb =================================================================== RCS file: /cvsroot/neelix/neelix/presenter/presenter.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- presenter.rb 29 Jun 2004 14:24:07 -0000 1.7 +++ presenter.rb 30 Jun 2004 14:34:06 -0000 1.8 @@ -1,6 +1,7 @@ # UI-independent (or mostly so) code that is also independent of the model. module Presenter def Presenter::promoteIngredient(recipe, i) + puts "#{recipe} #{i}" raise "Can't promote first ingredient" unless i > 0 sorted_ingredients = recipe.ingredients.sort sorted_ingredients[i].position, sorted_ingredients[i - 1].position = sorted_ingredients[i - 1].position, sorted_ingredients[i].position |