lib/formol/config.rb in formol-0.0.5 vs lib/formol/config.rb in formol-0.0.6
- old
+ new
@@ -2,16 +2,27 @@
class Config < Struct.new(:user_class,
:current_user_helper_method,
:formatter,
:email_from,
:text_formatter,
- :default_avatar)
+ :default_avatar,
+ :default_pygment_theme)
def user
@user ||= user_class.constantize
end
def default_avatar
@default_avatar || 'formol/default_avatar.png'
+ end
+
+ def default_pygment_theme
+ @default_pygment_theme || :pastie
+ end
+
+ def default_pygment_theme=(theme)
+ raise "pygments theme '#{theme}' does not exists. Please provide one of the following list:\n#{Formol.pygment_stylesheets.join(', ')}" unless Formol.pygment_stylesheets.include?(theme.to_sym)
+
+ @default_pygment_theme = theme
end
end
end
\ No newline at end of file