Sha256: 816d17b9bf3d4238841e2d1eed1ce98e456d17f9b351d0899cfead81ff0f11c0
Contents?: true
Size: 1.14 KB
Versions: 25
Compression:
Stored size: 1.14 KB
Contents
require "securerandom" module Extension module Models module ServerConfig class Extension < Base include SmartProperties property! :uuid, accepts: String property! :type, accepts: String property! :user, accepts: ServerConfig::User property! :development, accepts: ServerConfig::Development property :extension_points, accepts: Array property :version, accepts: String property :title, accepts: String def self.build(uuid: "", template:, type:, root_dir:) renderer = ServerConfig::DevelopmentRenderer.find(type) entry = ServerConfig::DevelopmentEntries.find(template) new( uuid: uuid.empty? ? generate_dev_uuid : uuid, type: type.downcase, user: ServerConfig::User.new, development: ServerConfig::Development.new( root_dir: root_dir, template: template, renderer: renderer, entries: entry ) ) end def self.generate_dev_uuid "dev-#{SecureRandom.uuid}" end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems