diff options
Diffstat (limited to 'lib/gitlab/static_site_editor/config/file_config/entry/mount.rb')
-rw-r--r-- | lib/gitlab/static_site_editor/config/file_config/entry/mount.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/gitlab/static_site_editor/config/file_config/entry/mount.rb b/lib/gitlab/static_site_editor/config/file_config/entry/mount.rb new file mode 100644 index 00000000000..b10956e17a5 --- /dev/null +++ b/lib/gitlab/static_site_editor/config/file_config/entry/mount.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Gitlab + module StaticSiteEditor + module Config + class FileConfig + module Entry + ## + # Entry that represents the mappings of mounted source directories to target paths + # + class Mount < ::Gitlab::Config::Entry::Node + include ::Gitlab::Config::Entry::Validatable + include ::Gitlab::Config::Entry::Attributable + + ALLOWED_KEYS = %i[source target].freeze + + attributes ALLOWED_KEYS + + validations do + validates :config, allowed_keys: ALLOWED_KEYS + + validates :source, type: String, presence: true + validates :target, type: String, presence: true, allow_blank: true + end + + def self.default + # NOTE: This is the default for middleman projects. Ideally, this would be determined + # based on the defaults for whatever `static_site_generator` is configured. + { + source: 'source', + target: '' + } + end + end + end + end + end + end +end |