Module Cms
In: app/controllers/cms/error_handling.rb
app/helpers/cms/application_helper.rb
app/helpers/cms/form_tag_helper.rb
app/helpers/cms/menu_helper.rb
app/helpers/cms/page_helper.rb
app/helpers/cms/path_helper.rb
app/helpers/cms/section_nodes_helper.rb
lib/cms/acts/content_block.rb
lib/cms/authentication/controller.rb
lib/cms/authentication/model.rb
lib/cms/behaviors/archiving.rb
lib/cms/behaviors/attaching.rb
lib/cms/behaviors/categorizing.rb
lib/cms/behaviors/connecting.rb
lib/cms/behaviors/dynamic_attributes.rb
lib/cms/behaviors/flush_cache_on_change.rb
lib/cms/behaviors/hiding.rb
lib/cms/behaviors/pagination.rb
lib/cms/behaviors/publishing.rb
lib/cms/behaviors/rendering.rb
lib/cms/behaviors/searching.rb
lib/cms/behaviors/soft_deleting.rb
lib/cms/behaviors/taggable.rb
lib/cms/behaviors/userstamping.rb
lib/cms/behaviors/versioning.rb
lib/cms/caching.rb
lib/cms/data_loader.rb
lib/cms/extensions/action_view/base.rb
lib/cms/extensions/active_record/base.rb
lib/cms/extensions/active_record/errors.rb
lib/cms/extensions/hash.rb
lib/cms/extensions/integer.rb
lib/cms/extensions/nil.rb
lib/cms/extensions/string.rb
lib/cms/init.rb

This is just a repackaged version of Will Paginate 2.2.2

Methods

Included Modules

Caching

Classes and Modules

Module Cms::Acts
Module Cms::ApplicationHelper
Module Cms::Authentication
Module Cms::Behaviors
Module Cms::Caching
Module Cms::DataLoader
Module Cms::ErrorHandling
Module Cms::Errors
Module Cms::Extensions
Module Cms::FormTagHelper
Module Cms::MenuHelper
Module Cms::PageHelper
Module Cms::PathHelper
Module Cms::Routes
Module Cms::SectionNodesHelper
Class Cms::ApplicationController
Class Cms::AttachmentsController
Class Cms::BaseController
Class Cms::CacheController
Class Cms::CategoriesController
Class Cms::CategoryTypesController
Class Cms::ConnectorsController
Class Cms::ContentBlockController
Class Cms::ContentController
Class Cms::ContentTypesController
Class Cms::DashboardController
Class Cms::DynamicViewsController
Class Cms::EmailMessagesController
Class Cms::FileBlocksController
Class Cms::FormBuilder
Class Cms::GroupsController
Class Cms::HomeController
Class Cms::HtmlBlocksController
Class Cms::ImageBlocksController
Class Cms::LinksController
Class Cms::PageRouteConditionsController
Class Cms::PageRouteOptionsController
Class Cms::PageRouteRequirementsController
Class Cms::PageRoutesController
Class Cms::PagesController
Class Cms::PortletController
Class Cms::PortletsController
Class Cms::RedirectsController
Class Cms::ResourceController
Class Cms::RoutesController
Class Cms::SectionNodesController
Class Cms::SectionsController
Class Cms::SessionsController
Class Cms::TagsController
Class Cms::TasksController
Class Cms::ToolbarController
Class Cms::UsersController

Constants

SPEC = eval(File.read(__root__ + '/browsercms.gemspec'))

Attributes

attachment_file_permission  [RW] 

Public Class methods

This is used by CMS modules to register with the CMS generator which files should be copied over to the app when the CMS generator is run. src_root is the absolute path to the root of the files, then each argument after that is a Dir.glob pattern string.

[Source]

    # File lib/cms/init.rb, line 40
40:     def add_generator_paths(src_root, *files)
41:       generator_paths << [src_root, files]
42:     end

[Source]

    # File lib/cms/init.rb, line 48
48:     def add_to_rails_paths(path)
49:       ActiveSupport::Dependencies.load_paths << File.join(path, "app", "portlets")
50:     end

[Source]

    # File lib/cms/init.rb, line 15
15:     def build_number; 236 end

[Source]

    # File lib/cms/init.rb, line 44
44:     def generator_paths
45:       @generator_paths ||= []
46:     end

This is called after the environment is ready

[Source]

    # File lib/cms/init.rb, line 22
22:     def init
23:       ActionController::Routing::RouteSet::Mapper.send :include, Cms::Routes
24:       ActiveSupport::Dependencies.load_paths += ??( #{RAILS_ROOT}/app/portlets )
25:       ActiveSupport::Dependencies.load_paths += ??( #{RAILS_ROOT}/app/portlets/helpers )      
26:       ActionController::Base.append_view_path DynamicView.base_path
27:       ActionView::Base.default_form_builder = Cms::FormBuilder
28:       
29:       # This is jsut to be safe
30:       # dynamic views are stored in a tmp dir
31:       # so they could be blown away on a server restart or something
32:       # so this just makes sure they get written out
33:       DynamicView.write_all_to_disk! if DynamicView.table_exists?
34:     end

[Source]

    # File lib/cms/init.rb, line 17
17:     def load_rake_tasks
18:       load "#{Cms.root}/lib/tasks/cms.rake"
19:     end

[Source]

    # File lib/cms/init.rb, line 52
52:     def markdown?
53:       Object.const_defined?("Markdown")
54:     end

[Source]

    # File lib/cms/init.rb, line 56
56:     def reserved_paths
57:       @reserved_paths ||= ["/cms", "/cache"]
58:     end

This next ‘hack’ is to allow script/generate browser_cms to work on Windows machines. I‘m not sure why this is necessary.

This Generator is adding an absolute file path to the manifest, which is file (like a .js or migration) in the gem directory on the developers‘s machine, rather than just a relative path with the rails_generator directory. On windows, this will mean you are basically doing this.

m.file "C:/Ruby/lib/ruby/gems/1.8/gems/browsercms-3.0.0/public/javascripts/jquery-ui.js", "testing/jquery-ui.js"

When the generator hits this command during playback, it will throw an error like this:

  Pattern 'c' matches more than one generator: content_block, controller

The generator then fails and stops copying. Stripping the C: off the front seems to fix this problem. I.e. This command correctly copies the file on Windows XP.

  m.file "/Ruby/lib/ruby/gems/1.8/gems/browsercms-3.0.0/public/javascripts/jquery-ui.js", "testing/jquery-ui.js"

[Source]

    # File lib/cms/init.rb, line 74
74:     def scrub_path(path)
75:       windows_drive_pattern =  /[A-Z\\A]:\//    # Works on drives labeled A-Z:
76:       scrubbed_source_file_name = path.gsub(windows_drive_pattern, "/")
77:     end

[Source]

    # File lib/cms/init.rb, line 11
11:     def version
12:       @version = SPEC.version.version
13:     end

[Validate]