ref: refs/heads/jr_ntp
commit 812275eb8600c279e64f867fb0af6a1fcbb0b151
Author: Josef Reidinger
Date: Thu Aug 20 13:17:24 2009 +0200
first initial working version of base system, expect rapid changes
---
.../app/controllers/basesystem_controller.rb | 2 +-
plugins/basesystem/app/models/basesystem.rb | 9 +++------
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/plugins/basesystem/app/controllers/basesystem_controller.rb b/plugins/basesystem/app/controllers/basesystem_controller.rb
index 311861f..2e7ce57 100644
--- a/plugins/basesystem/app/controllers/basesystem_controller.rb
+++ b/plugins/basesystem/app/controllers/basesystem_controller.rb
@@ -13,7 +13,7 @@ class BasesystemController < ApplicationController
@basesystem = Basesystem.find
@basesystem.next_step params[:basesystem][:current]
@basesystem.save
- render :index
+ render :show
end
def create
diff --git a/plugins/basesystem/app/models/basesystem.rb b/plugins/basesystem/app/models/basesystem.rb
index f87cb1f..14988bc 100644
--- a/plugins/basesystem/app/models/basesystem.rb
+++ b/plugins/basesystem/app/models/basesystem.rb
@@ -33,9 +33,9 @@ class Basesystem
ret.current = ret.steps.empty? ? END_STRING : ret.steps[0]
else
fh = File.new(CURRENT_STEP_FILE,"r")
- ret.current = fh.gets
+ ret.current = fh.gets.chomp
fh.close
- if ret.steps.include(ret.current) #invalid step
+ if ret.steps.include?(ret.current) #invalid step
Rails.logger.warn "invalid step in current"
ret.current = END_STRING
end
@@ -45,12 +45,9 @@ class Basesystem
end
def next_step (current)
- if (current != @current) #concurent modification
- return
- end
index = @steps.index current
- if index == (@steps.size -1)
+ if index == @steps.size() -1
@current = END_STRING
else
@current = @steps[index+1]
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org