Class: Plum::Configuration
- Inherits:
-
Object
- Object
- Plum::Configuration
- Defined in:
- lib/plum/configuration.rb
Instance Attribute Summary collapse
-
#authorize_with ⇒ Object
Returns the value of attribute authorize_with.
-
#content_sources ⇒ Object
readonly
Returns the value of attribute content_sources.
-
#cp_accent_color ⇒ Object
Returns the value of attribute cp_accent_color.
-
#cp_back_label ⇒ Object
Returns the value of attribute cp_back_label.
-
#cp_back_url ⇒ Object
Returns the value of attribute cp_back_url.
-
#cp_logo_path ⇒ Object
Returns the value of attribute cp_logo_path.
-
#cp_name ⇒ Object
Returns the value of attribute cp_name.
-
#cp_sidebar_bg ⇒ Object
Returns the value of attribute cp_sidebar_bg.
-
#cp_sidebar_header_bg ⇒ Object
Returns the value of attribute cp_sidebar_header_bg.
-
#cp_sidebar_muted ⇒ Object
Returns the value of attribute cp_sidebar_muted.
-
#cp_sidebar_text ⇒ Object
Returns the value of attribute cp_sidebar_text.
-
#cp_subtitle ⇒ Object
Returns the value of attribute cp_subtitle.
-
#current_site_resolver ⇒ Object
Returns the value of attribute current_site_resolver.
-
#current_user_resolver ⇒ Object
Returns the value of attribute current_user_resolver.
-
#host_authorization_resolver ⇒ Object
Returns the value of attribute host_authorization_resolver.
-
#mailer_sender ⇒ Object
Returns the value of attribute mailer_sender.
-
#powered_by_name ⇒ Object
Returns the value of attribute powered_by_name.
-
#powered_by_url ⇒ Object
Returns the value of attribute powered_by_url.
- #theme_paths ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #register_content_source(handle, source = nil, &block) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/plum/configuration.rb', line 13 def initialize @authorize_with = :plum @mailer_sender = "no-reply@example.com" @cp_name = "Plum" @cp_subtitle = "CMS" @cp_logo_path = "plum-mark.svg" @cp_accent_color = "#7c3aed" @cp_sidebar_bg = "#241B27" @cp_sidebar_header_bg = "#1E1621" @cp_sidebar_text = "#D9CBD4" @cp_sidebar_muted = "#A8929F" @cp_back_url = nil @cp_back_label = "← Back" @powered_by_name = "Plum" @powered_by_url = "https://plumcms.com" @content_sources = ContentSourceRegistry.new @current_site_resolver = ->(_controller) { Plum::Site.first_or_create_standalone! } @current_user_resolver = lambda { |controller| Plum::User.find_by(id: controller.session[:plum_user_id]) if controller.session[:plum_user_id] } @host_authorization_resolver = ->(controller) { Plum.current_user(controller).present? } end |
Instance Attribute Details
#authorize_with ⇒ Object
Returns the value of attribute authorize_with.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def @authorize_with end |
#content_sources ⇒ Object (readonly)
Returns the value of attribute content_sources.
11 12 13 |
# File 'lib/plum/configuration.rb', line 11 def content_sources @content_sources end |
#cp_accent_color ⇒ Object
Returns the value of attribute cp_accent_color.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def cp_accent_color @cp_accent_color end |
#cp_back_label ⇒ Object
Returns the value of attribute cp_back_label.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def cp_back_label @cp_back_label end |
#cp_back_url ⇒ Object
Returns the value of attribute cp_back_url.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def cp_back_url @cp_back_url end |
#cp_logo_path ⇒ Object
Returns the value of attribute cp_logo_path.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def cp_logo_path @cp_logo_path end |
#cp_name ⇒ Object
Returns the value of attribute cp_name.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def cp_name @cp_name end |
#cp_sidebar_bg ⇒ Object
Returns the value of attribute cp_sidebar_bg.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def @cp_sidebar_bg end |
#cp_sidebar_header_bg ⇒ Object
Returns the value of attribute cp_sidebar_header_bg.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def @cp_sidebar_header_bg end |
#cp_sidebar_muted ⇒ Object
Returns the value of attribute cp_sidebar_muted.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def @cp_sidebar_muted end |
#cp_sidebar_text ⇒ Object
Returns the value of attribute cp_sidebar_text.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def @cp_sidebar_text end |
#cp_subtitle ⇒ Object
Returns the value of attribute cp_subtitle.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def cp_subtitle @cp_subtitle end |
#current_site_resolver ⇒ Object
Returns the value of attribute current_site_resolver.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def current_site_resolver @current_site_resolver end |
#current_user_resolver ⇒ Object
Returns the value of attribute current_user_resolver.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def current_user_resolver @current_user_resolver end |
#host_authorization_resolver ⇒ Object
Returns the value of attribute host_authorization_resolver.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def @host_authorization_resolver end |
#mailer_sender ⇒ Object
Returns the value of attribute mailer_sender.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def mailer_sender @mailer_sender end |
#powered_by_name ⇒ Object
Returns the value of attribute powered_by_name.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def powered_by_name @powered_by_name end |
#powered_by_url ⇒ Object
Returns the value of attribute powered_by_url.
5 6 7 |
# File 'lib/plum/configuration.rb', line 5 def powered_by_url @powered_by_url end |
#theme_paths ⇒ Object
36 37 38 |
# File 'lib/plum/configuration.rb', line 36 def theme_paths Array(@theme_paths.presence || default_theme_paths).map { |path| Pathname(path) }.uniq(&:to_s) end |
Instance Method Details
#register_content_source(handle, source = nil, &block) ⇒ Object
40 41 42 |
# File 'lib/plum/configuration.rb', line 40 def register_content_source(handle, source = nil, &block) content_sources.register(handle, source, &block) end |