Sha256: 713ac8dd0a213e8886bb0ef255f4e5f743a96e4c208c4df30b2b70bfd6ce20b6

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

require 'liquid_cms'
require 'simple_form'
require 'zip/zip'
require 'will_paginate'
require 'redcloth'

config.to_prepare do
  ApplicationController.helper(Cms::CommonHelper, Cms::AssetsHelper, Cms::ComponentsHelper, Cms::PagesHelper)
end

I18n.load_path += Dir[Rails.root.join('config', 'locales', 'cms', '*.{rb,yml}').to_s] 

if defined?(Liquid)
  # adds files to the load path
  add_files_to_load_path = lambda {|dir|
    path = File.expand_path(dir)
    $LOAD_PATH << path
    if ActiveSupport::Dependencies.respond_to?(:autoload_paths)
      ActiveSupport::Dependencies.autoload_paths << path
      ActiveSupport::Dependencies.autoload_once_paths.delete(path)
    else
      ActiveSupport::Dependencies.load_paths << path
      ActiveSupport::Dependencies.load_once_paths.delete(path)
    end
    Dir[File.join(path, '*.rb')].each{|f| require f}
  }

  # add liquid files to load path
  load_liquid_paths = lambda {|base|
    add_files_to_load_path.call File.join(base, 'app', 'liquid')
    %w{filters tags drops}.each do |dir|
      add_files_to_load_path.call File.join(base, 'app', 'liquid', dir)
    end
  }

  # load the cms paths first so that the main app can make use of existing classes
  load_liquid_paths.call File.join(File.dirname(__FILE__), '..')
  # load the main apps paths next
  load_liquid_paths.call Rails.root.to_s
end

ActiveSupport::Inflector.inflections do |inflect|
  inflect.human 'Cms::Page', 'Page'
  inflect.human 'Cms::Asset', 'Asset'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
liquid_cms-0.2.2.0 rails/init.rb
liquid_cms-0.2.1.1 rails/init.rb
liquid_cms-0.2.1.0 rails/init.rb