Class: GlobalSettings
- Inherits:
-
Object
- Object
- GlobalSettings
- Defined in:
- lib/file_sv/global_settings.rb
Overview
Settings to configure this gem
Class Attribute Summary collapse
-
.cert ⇒ String
Path to HTTPS cert.
-
.default_method ⇒ String
Default REST method when none specified by filename.
-
.empty_body_status ⇒ Integer
Default status of response when file is empty.
-
.https ⇒ Boolean
Whether to serve https using self signed certificate.
-
.ignore_files ⇒ Array
Expression representing files to ignore.
-
.ignore_status_codes ⇒ Array
List of http status codes to ignore.
-
.key ⇒ String
Path to HTTPS key.
-
.serving_folder ⇒ String
Path from current location to serve folders from.
Class Method Summary collapse
-
.ignored_status?(status_code) ⇒ Boolean
Whether status code is currently ignored.
Class Attribute Details
.cert ⇒ String
Returns Path to HTTPS cert.
26 27 28 |
# File 'lib/file_sv/global_settings.rb', line 26 def cert @cert end |
.default_method ⇒ String
Returns Default REST method when none specified by filename.
18 19 20 |
# File 'lib/file_sv/global_settings.rb', line 18 def default_method @default_method end |
.empty_body_status ⇒ Integer
Returns Default status of response when file is empty.
20 21 22 |
# File 'lib/file_sv/global_settings.rb', line 20 def empty_body_status @empty_body_status end |
.https ⇒ Boolean
Returns Whether to serve https using self signed certificate. Deprecated now.
24 25 26 |
# File 'lib/file_sv/global_settings.rb', line 24 def https @https end |
.ignore_files ⇒ Array
Returns Expression representing files to ignore.
22 23 24 |
# File 'lib/file_sv/global_settings.rb', line 22 def ignore_files @ignore_files end |
.ignore_status_codes ⇒ Array
Returns List of http status codes to ignore.
30 31 32 |
# File 'lib/file_sv/global_settings.rb', line 30 def ignore_status_codes @ignore_status_codes end |
.key ⇒ String
Returns Path to HTTPS key.
28 29 30 |
# File 'lib/file_sv/global_settings.rb', line 28 def key @key end |
.serving_folder ⇒ String
Returns Path from current location to serve folders from.
32 33 34 |
# File 'lib/file_sv/global_settings.rb', line 32 def serving_folder @serving_folder end |
Class Method Details
.ignored_status?(status_code) ⇒ Boolean
Returns Whether status code is currently ignored.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/file_sv/global_settings.rb', line 36 def ignored_status?(status_code) return unless ignore_status_codes ignore_status_codes.split(",").each do |code| regex = Regexp.new code.to_s result = status_code.to_s[regex] next unless result return true unless result.empty? end false end |