Class: Ferver::Configuration
- Inherits:
-
Object
- Object
- Ferver::Configuration
- Defined in:
- lib/ferver/configuration.rb
Constant Summary collapse
- DEFAULT_FILE_SERVER_DIR_PATH =
By default, serve files from current location when the gem is called.
"./".freeze
Instance Attribute Summary collapse
- #directory ⇒ Object
-
#directory_path ⇒ Object
Return the absolute path to the directory Ferver is serving files from.
-
#serve_hidden ⇒ Object
(also: #serve_hidden?)
Default to not serving hidden files.
Instance Method Summary collapse
-
#initialize(directory_path = DEFAULT_FILE_SERVER_DIR_PATH, serve_hidden = false) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(directory_path = DEFAULT_FILE_SERVER_DIR_PATH, serve_hidden = false) ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 |
# File 'lib/ferver/configuration.rb', line 18 def initialize(directory_path = DEFAULT_FILE_SERVER_DIR_PATH, serve_hidden = false) @directory_path = directory_path @serve_hidden = serve_hidden end |
Instance Attribute Details
#directory ⇒ Object
23 24 25 |
# File 'lib/ferver/configuration.rb', line 23 def directory @directory ||= FerverDirectory.new(self) end |
#directory_path ⇒ Object
Return the absolute path to the directory Ferver is serving files from.
8 9 10 |
# File 'lib/ferver/configuration.rb', line 8 def directory_path @directory_path end |
#serve_hidden ⇒ Object Also known as:
Default to not serving hidden files.
11 12 13 |
# File 'lib/ferver/configuration.rb', line 11 def serve_hidden @serve_hidden end |