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.94 lib/knj/fs/fs.rb
knjrbfw-0.0.93 lib/knj/fs/fs.rb
knjrbfw-0.0.92 lib/knj/fs/fs.rb
knjrbfw-0.0.91 lib/knj/fs/fs.rb
knjrbfw-0.0.90 lib/knj/fs/fs.rb
knjrbfw-0.0.89 lib/knj/fs/fs.rb
knjrbfw-0.0.88 lib/knj/fs/fs.rb
knjrbfw-0.0.87 lib/knj/fs/fs.rb
knjrbfw-0.0.86 lib/knj/fs/fs.rb
knjrbfw-0.0.85 lib/knj/fs/fs.rb
knjrbfw-0.0.84 lib/knj/fs/fs.rb
knjrbfw-0.0.83 lib/knj/fs/fs.rb
knjrbfw-0.0.82 lib/knj/fs/fs.rb
knjrbfw-0.0.81 lib/knj/fs/fs.rb
knjrbfw-0.0.80 lib/knj/fs/fs.rb
knjrbfw-0.0.79 lib/knj/fs/fs.rb
knjrbfw-0.0.78 lib/knj/fs/fs.rb
knjrbfw-0.0.77 lib/knj/fs/fs.rb
knjrbfw-0.0.75 lib/knj/fs/fs.rb
knjrbfw-0.0.74 lib/knj/fs/fs.rb