Class: M2Config::Dir
- Inherits:
-
Object
- Object
- M2Config::Dir
- Defined in:
- lib/m2config/dir.rb
Instance Method Summary collapse
-
#initialize(fields) ⇒ Dir
constructor
A new instance of Dir.
- #type ⇒ Object
Constructor Details
#initialize(fields) ⇒ Dir
Returns a new instance of Dir.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/m2config/dir.rb', line 5 def initialize( fields ) fields[:default_ctype] ||= "application/octet-stream" fields[:index_file] ||= "index.html" raise ArgumentError, "Base directories are relative to chroot and must not start with a slash (as in your <#{fields[:base]}>)" if fields[:base] =~ /^\/.+/ raise ArgumentError, "Base directories must end with a slash (your <#{fields[:base]}> does not)" if !(fields[:base] =~ /\/$/) super(fields, false) save end |
Instance Method Details
#type ⇒ Object
16 17 18 |
# File 'lib/m2config/dir.rb', line 16 def type "dir" end |