Sha256: b92651039e0d40ece9a6442331c58927b162414e5951974fbeae22e5f35b7cbe
Contents?: true
Size: 789 Bytes
Versions: 40
Compression:
Stored size: 789 Bytes
Contents
class Knj::Fs @drivers = [] drivers_path = Php4r.realpath("#{File.dirname(__FILE__)}/drivers") Dir.new(drivers_path).each do |file| fn = "#{drivers_path}/#{file}" next if file == "." or file == ".." or File.directory?(fn) class_name = Php4r.ucwords(file.slice(0..-4)).to_sym print "Classname: #{class_name}\n" autoload class_name, fn @drivers << { :name => file.slice(0..-4), :args => const_get(class_name).args } end def self.drivers return @drivers end def initialize(args = {}) @args = args end def spawn_driver class_name = Php4r.ucwords(@args[:driver]) @driver = self.class.const_get(class_name).new(:fs => self, :args => @args) end end class Knj::Fs::File def initialize end end
Version data entries
40 entries across 40 versions & 1 rubygems