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

Version Path
knjrbfw-0.0.116 lib/knj/fs/fs.rb
knjrbfw-0.0.115 lib/knj/fs/fs.rb
knjrbfw-0.0.114 lib/knj/fs/fs.rb
knjrbfw-0.0.113 lib/knj/fs/fs.rb
knjrbfw-0.0.111 lib/knj/fs/fs.rb
knjrbfw-0.0.110 lib/knj/fs/fs.rb
knjrbfw-0.0.109 lib/knj/fs/fs.rb
knjrbfw-0.0.108 lib/knj/fs/fs.rb
knjrbfw-0.0.107 lib/knj/fs/fs.rb
knjrbfw-0.0.105 lib/knj/fs/fs.rb
knjrbfw-0.0.104 lib/knj/fs/fs.rb
knjrbfw-0.0.103 lib/knj/fs/fs.rb
knjrbfw-0.0.102 lib/knj/fs/fs.rb
knjrbfw-0.0.101 lib/knj/fs/fs.rb
knjrbfw-0.0.100 lib/knj/fs/fs.rb
knjrbfw-0.0.99 lib/knj/fs/fs.rb
knjrbfw-0.0.98 lib/knj/fs/fs.rb
knjrbfw-0.0.97 lib/knj/fs/fs.rb
knjrbfw-0.0.96 lib/knj/fs/fs.rb
knjrbfw-0.0.95 lib/knj/fs/fs.rb