Class: Simple::Httpd::MountSpec::PathMountSpec
- Inherits:
-
Simple::Httpd::MountSpec
- Object
- Simple::Httpd::MountSpec
- Simple::Httpd::MountSpec::PathMountSpec
- Defined in:
- lib/simple/httpd/mount_spec.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#mount_point ⇒ Object
readonly
Returns the value of attribute mount_point.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #build_rack_apps ⇒ Object
-
#initialize(mount_point, path) ⇒ PathMountSpec
constructor
A new instance of PathMountSpec.
Methods inherited from Simple::Httpd::MountSpec
normalize_and_verify_mount_point
Constructor Details
#initialize(mount_point, path) ⇒ PathMountSpec
Returns a new instance of PathMountSpec.
50 51 52 |
# File 'lib/simple/httpd/mount_spec.rb', line 50 def initialize(mount_point, path) @mount_point, @path = mount_point, path end |
Instance Attribute Details
#mount_point ⇒ Object (readonly)
Returns the value of attribute mount_point.
39 40 41 |
# File 'lib/simple/httpd/mount_spec.rb', line 39 def mount_point @mount_point end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
39 40 41 |
# File 'lib/simple/httpd/mount_spec.rb', line 39 def path @path end |
Class Method Details
.build(mount_point, path:) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/simple/httpd/mount_spec.rb', line 41 def self.build(mount_point, path:) path = path.gsub(/\/$/, "") # remove trailing "/" raise ArgumentError, "You probably don't want to mount your root directory, check mount_spec" if path == "" return unless Dir.exist?(path) new(mount_point, path) end |