class ScrollController < ApplicationController # def first_time # session[:separator]='`' # session[:choices]=nil # redirect_to :action => "index" # end def get_title 'scroll text up' end def get_separator '`' end def get_choices t=get_text b=get_overflow shiftrx=[/./, /../, #first char(s) /^\W*\w+/, #first word /.*[.?!;]/, #first sentence /.*\n/] #first para c=[] #choices shiftrx.each do |r| if b=~r c<< t+ $~.to_s+ '||' + $~.post_match end end c.uniq end def reformat_choices end def selected(str) session[:text],session[:overflow]= str.split('||') session[:choices]=nil end def extras @text=get_text @overflow=get_overflow end end