Pathname Objects

Web#files_path and Web#blatex_pngs_path now return Pathname objects.
Based on JHerdman's
5d1e8f420b
but requires several other changes to the code (which assumed a string).

Also, test for itex2MML 1.3.10 (you should update that too).
This commit is contained in:
Jacques Distler 2009-08-28 11:10:34 -05:00
parent c05d69bcff
commit 336e57d6b4
4 changed files with 17 additions and 13 deletions

View file

@ -128,21 +128,18 @@ class Web < ActiveRecord::Base
"#{File.expand_path(dir)} and add files to it."
end
end
def files_path
path = Rails.root.join("webs")
if default_web?
"#{RAILS_ROOT}/webs/files"
path.join("files")
else
"#{RAILS_ROOT}/webs/#{self.address}/files"
path.join(address, "files")
end
end
def blahtex_pngs_path
if default_web?
"#{RAILS_ROOT}/webs/files/pngs"
else
"#{RAILS_ROOT}/webs/#{self.address}/files/pngs"
end
files_path.join("pngs")
end
private