Sha256: 9ad6b17d3721ab2bfa541d191fd0f646f9b4c4b0c9c31b5e6b887dc5d0752982

Contents?: true

Size: 925 Bytes

Versions: 1

Compression:

Stored size: 925 Bytes

Contents

require_relative './config/menu_item'
module Geri
  module Config
    include ActiveSupport::Configurable
    config_accessor :admin_path                         # route to the administrative backend
    config_accessor :menu_items, instance_reader: false # menu item registry
    config_accessor :site_name                          # name of the site
    config_accessor :mount_point                        # sets the mount point for the Geri::Engine

    # Defaults
    self.admin_path  = '/admin'
    self.menu_items  = []
    self.mount_point = '/'

    def self.register_menu_item(title, path_or_options=nil, options={})
      self.menu_items << item = MenuItem.new(title, path_or_options, options)
      yield item if block_given?
      self.menu_items.sort! { |a,b| a.priority <=> b.priority }
    end

    # configure override
    def self.configure(&block)
      begin
        yield self
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geri-0.0.1 lib/geri/config.rb