Sha256: 19c007e52076cc68ede6b348b1f853e761a0b9a86e699387af03e457ea623d44

Contents?: true

Size: 1.08 KB

Versions: 12

Compression:

Stored size: 1.08 KB

Contents

require 'rails'
require 'thin_man'
require 'hooch'
require 'carrierwave'
require 'friendly_id'
require 'select2-rails'
require 'pulitzer/engine'

module Pulitzer
  mattr_accessor  :base_controller, :metadata_closure, :authentication_closure,
  :tagging_models, :layout, :text_editor_toolbars

  def self.config(options)
    base_controller_name = options[:base_controller_name]
    @@base_controller         = base_controller_name.constantize
    @@metadata_closure        = options[:metadata_authorization]
    @@authentication_closure  = options[:authentication]
    @@tagging_models          = options[:tagging_models] || []
    @@layout                  = options[:layout] || 'application'
    default_text_editor       = [{ name: 'None', template: 'pulitzer/text_editors/none'}]
    user_text_editors         = options[:text_editor_toolbars].flatten || nil
    @@text_editor_toolbars    = default_text_editor.push(*user_text_editors).compact
  end

  def self.skip_metadata_auth?
    self.metadata_closure.blank?
  end

  def self.skip_authentication?
    self.authentication_closure.blank?
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pulitzer-0.1.10 lib/pulitzer.rb
pulitzer-0.1.9 lib/pulitzer.rb
pulitzer-0.1.8 lib/pulitzer.rb
pulitzer-0.1.7 lib/pulitzer.rb
pulitzer-0.1.6 lib/pulitzer.rb
pulitzer-0.1.5 lib/pulitzer.rb
pulitzer-0.1.4 lib/pulitzer.rb
pulitzer-0.1.3 lib/pulitzer.rb
pulitzer-0.1.2 lib/pulitzer.rb
pulitzer-0.1.1 lib/pulitzer.rb
pulitzer-0.1.0 lib/pulitzer.rb
pulitzer-0.0.5 lib/pulitzer.rb