44 |
# or absolute path name given. |
# or absolute path name given. |
45 |
# |
# |
46 |
def self.user_filename(filespec) |
def self.user_filename(filespec) |
47 |
return nil if @@userdir.nil? || filespec[0..0]==File::SEPARATOR |
return nil if @@userdir.nil? || File.absolute_path?(filespec) |
48 |
return File.expand_path(File.join(@@userdir,filespec)) |
return File.expand_path(File.join(@@userdir,filespec)) |
49 |
end |
end |
50 |
|
|
55 |
def self.save(base_slot, filespec, name, version) |
def self.save(base_slot, filespec, name, version) |
56 |
user_filespec = user_filename(filespec) |
user_filespec = user_filename(filespec) |
57 |
if user_filespec.nil? |
if user_filespec.nil? |
58 |
filespec = File.join($FR_CODEBASE,filespec) if filespec[0..0] != File::SEPARATOR |
filespec = File.join($FR_CODEBASE,filespec) unless File.absolute_path?(filespec) |
59 |
else |
else |
60 |
filespec = user_filespec |
filespec = user_filespec |
61 |
# if file first saved make sure to create the full path first |
# if file first saved make sure to create the full path first |
93 |
if !user_filespec.nil? && File.exist?(user_filespec) |
if !user_filespec.nil? && File.exist?(user_filespec) |
94 |
filespec = user_filespec |
filespec = user_filespec |
95 |
else |
else |
96 |
filespec = File.join($FR_CODEBASE,filespec) if filespec[0..0] != File::SEPARATOR |
filespec = File.join($FR_CODEBASE,filespec) unless File.absolute_path?(filespec) |
97 |
end |
end |
98 |
#puts "Loading Property File: #{filespec}" |
#puts "Loading Property File: #{filespec}" |
99 |
return unless File.exist?(filespec) |
return unless File.exist?(filespec) |
165 |
def load_files |
def load_files |
166 |
plugin_element = nil |
plugin_element = nil |
167 |
@configuration.plugin_paths.split(";").each do |path| |
@configuration.plugin_paths.split(";").each do |path| |
168 |
fullpath = File.join($FR_CODEBASE,path) if path[0..0] != File::SEPARATOR |
fullpath = File.join($FR_CODEBASE,path) unless File.absolute_path?(path) |
169 |
Dir.foreach(fullpath) do |file| |
Dir.foreach(fullpath) do |file| |
170 |
next if file=='..' || file=='.' |
next if file=='..' || file=='.' |
171 |
if File.stat("#{fullpath}/#{file}").directory? |
if File.stat("#{fullpath}/#{file}").directory? |