src/iowa/Application.rb in IOWA-1.0.2 vs src/iowa/Application.rb in IOWA-1.0.3
- old
+ new
@@ -709,11 +709,11 @@
end
# Given a component name, finds the path to it.
def pathForName(name)
- name.gsub!(/Iowa::Application::ContentClasses::/,C_empty)
+ name = name.gsub(/Iowa::Application::ContentClasses::/,C_empty)
return @pathNameCache[name] if @templateLTimes.has_key?(name) and (@templateLTimes[name] < Time.now)
my_docroot = @docroot
my_docroot << C_slash unless my_docroot[-1,1] == C_slash
pfn_pre = my_docroot + name.gsub(/::/,C_slash)
@@ -731,11 +731,11 @@
end
# Extract the code and bindings from the code data.
def get_code_and_bindings(codedata)
- codedata.sub!(/<\?(.*?)\?>/m, C_empty)
+ codedata = codedata.sub(/<\?(.*?)\?>/m, C_empty)
bindings = ''
bindings = $1.gsub(BindingCommentsRegexp,C_empty) if $1
if m = /<%(.*?)%>/m.match(codedata)
code = m[1]
else
@@ -765,17 +765,17 @@
end
else
codedata = data.gsub(/\cM/,C_empty)
unless /<%.*?%>/m.match(codedata)
codedata,codefile_path = defaultScript(file)
- codedata.gsub!(/\cM/,C_empty)
+ codedata = codedata.gsub(/\cM/,C_empty)
code_text, bindings_text = *get_code_and_bindings(codedata)
else
codefile_path = file.path
- codedata.sub!(/<%(.*?)%>/m, C_empty)
+ codedata = codedata.sub(/<%(.*?)%>/m, C_empty)
code_text = $1
- codedata.sub!(/<\?(.*?)\?>/m, C_empty)
+ codedata = codedata.sub(/<\?(.*?)\?>/m, C_empty)
bindings_text = $1.gsub(BindingCommentsRegexp,C_empty) if $1
data = codedata
end
end
@@ -881,11 +881,11 @@
my_docroot = @docroot
my_docroot << C_slash unless my_docroot[-1,1] == C_slash
my_docroot_minus_slash = my_docroot.sub(/\/$/,C_empty)
filepath = file.path
- filepath.sub!(/#{my_docroot}/,C_empty)
+ filepath = filepath.sub(/#{my_docroot}/,C_empty)
path_parts = filepath.split(C_slash)
# Knock the filename off of the array.
path_parts.pop
# And put the docroot path onto the beginning of the array.
@@ -910,10 +910,10 @@
r << "<%class [--CLASSNAME--] < Iowa::Component; end%>"
df_found = 'INTERNAL'
mylog.info "Used basic scriptfile for #{file.path}"
end
- r.gsub!(/\[--CLASSNAME--\]/,name)
+ r = r.gsub(/\[--CLASSNAME--\]/,name)
[r,df_found]
end
# Make this something that can be configured.