/[freeride]/freeride/freebase/lib/freebase/readers.rb
ViewVC logotype

Diff of /freeride/freebase/lib/freebase/readers.rb

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by ljulliar, Thu May 1 12:34:39 2003 UTC revision 1.4 by ljulliar, Tue Jul 1 07:35:53 2003 UTC
# Line 44  module FreeBASE Line 44  module FreeBASE
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    
# Line 55  module FreeBASE Line 55  module FreeBASE
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
# Line 93  module FreeBASE Line 93  module FreeBASE
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)
# Line 165  module FreeBASE Line 165  module FreeBASE
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?

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26