Module: Burp

Defined in:
lib/burp_cms.rb,
lib/burp/engine.rb,
lib/burp/version.rb,
app/lib/burp/link.rb,
app/lib/burp/page.rb,
app/lib/burp/util.rb,
app/lib/burp/group.rb,
app/lib/burp/access.rb,
app/models/burp/menu.rb,
app/models/burp/file_model.rb,
app/models/burp/page_model.rb,
app/lib/burp/util/upload_handler.rb,
app/helpers/burp/application_helper.rb,
app/controllers/burp/error_controller.rb,
app/controllers/burp/files_controller.rb,
app/controllers/burp/links_controller.rb,
app/controllers/burp/menus_controller.rb,
app/controllers/burp/pages_controller.rb,
app/controllers/burp/groups_controller.rb,
app/controllers/burp/static_controller.rb,
app/controllers/burp/application_controller.rb

Overview

All paths to directories are expected to end with a slash.

Like this /home/darwin/

Defined Under Namespace

Modules: ApplicationHelper, Util Classes: Access, ApplicationController, CatchAllController, Engine, ErrorController, FileModel, FilesController, Group, GroupsController, Link, LinksController, Menu, MenusController, Page, PageModel, PagesController, StaticController

Constant Summary collapse

VERSION =
"1.3.11"
@@content_directory =
nil

Class Method Summary collapse

Class Method Details

.accessObject



24
25
26
# File 'lib/burp_cms.rb', line 24

def self.access
  @@access ||= MayI::Access.new("Burp::Access")
end

.content_directoryObject

Returns the content directory to use.



33
34
35
# File 'lib/burp_cms.rb', line 33

def self.content_directory
  Thread.current[:thread_local_content_directory] || @@content_directory || Rails.root.join('app/cms/').to_s
end

.find_page(path) ⇒ Object



15
16
17
18
19
20
# File 'lib/burp_cms.rb', line 15

def self.find_page(path)
  page_model = Burp::PageModel.find(path)
  if page_model 
    Page.new(:snippets => page_model.snippets, :title => page_model.title)
  end
end

.global_content_directory=(path) ⇒ Object

Sets the content directory



50
51
52
53
# File 'lib/burp_cms.rb', line 50

def self.global_content_directory=(path)
  raise "#{path} does not end with '/'" unless path.end_with?('/')
  @@content_directory = path
end

.thread_local_content_directory=(path) ⇒ Object

Sets the content directory for the current thread



58
59
60
61
# File 'lib/burp_cms.rb', line 58

def self.thread_local_content_directory=(path)
  raise "#{path} does not end with '/'" unless path.end_with?('/')
  Thread.current[:thread_local_content_directory] = path
end

.with_content_directory(path, &block) ⇒ Object

Runs the block with the content directory temporarly set to the supplied path



40
41
42
43
44
45
# File 'lib/burp_cms.rb', line 40

def self.with_content_directory(path,&block)
  self.thread_local_content_directory = path
  block.call
ensure  
  self.thread_local_content_directory = nil
end