Add new map & fix old maps.

This commit is contained in:
Glenn Y. Rolland 2015-11-05 22:59:36 +01:00
parent 236e095d83
commit d3309f0344
4 changed files with 33 additions and 11 deletions

View file

@ -1,10 +1,8 @@
require 'fileutils'
require 'pp'
module Qasim ; module Map
end ; end
class Qasim::Map::Generic
module Qasim ; class Map; class Generic
attr_reader :links
attr_reader :filename
attr_reader :name
@ -70,5 +68,4 @@ class Qasim::Map::Generic
def umount
raise NotImplementedError
end
end
end ; end ; end

24
lib/qasim/map/smb.rb Normal file
View file

@ -0,0 +1,24 @@
# vim: set ts=2 sw=2 et:
require 'fileutils'
require 'qasim/map/generic'
class Qasim::Map::Webdav < Qasim::Map::Generic
def initialize *opts
super
end
def self.parameters
super.merge({
webdav_user: { required: true}, # ex : foo
webdav_password: { required: true}, # ex : bar
webdav_port: { default: 80}, # ex : 80, 8080, 443
webdav_protocol: { default: :http} # ex : http, https
})
end
def self.handles
[ :webdav, :webdavs ]
end
end

View file

@ -2,7 +2,7 @@
require 'fileutils'
require 'qasim/map/generic'
class Qasim::Map::Ssh < Qasim::Map::Generic
module Qasim ; class Map ; class Ssh < Qasim::Map::Generic
attr_reader :path,
:host,
:port,
@ -130,5 +130,5 @@ class Qasim::Map::Ssh < Qasim::Map::Generic
end
end
end
end
end ; end ; end

View file

@ -4,20 +4,21 @@ require 'fileutils'
require 'qasim/map/generic'
class Qasim::Map::Webdav < Qasim::Map::Generic
def initialize
def initialize *opts
super
end
def self.parameters
super.merge({
webdav_user: { required: true}, # ex : foo
webdav_password: { required: true}, # ex : bar
webdav_port: { default: 80}, # ex : 80, 8080, ...
webdav_port: { default: 80}, # ex : 80, 8080, 443
webdav_protocol: { default: :http} # ex : http, https
})
end
def self.handles
[ :webdav, :fusedav ]
[ :webdav, :webdavs ]
end
end