Module: EffectivePages
- Includes:
- EffectiveGem
- Defined in:
- lib/effective_pages.rb,
lib/effective_pages/engine.rb,
lib/effective_pages/version.rb,
lib/generators/effective_pages/install_generator.rb
Defined Under Namespace
Modules: Generators Classes: Engine
Constant Summary collapse
- VERSION =
'1.3.0'.freeze
Class Method Summary collapse
- .config_keys ⇒ Object
- .layouts ⇒ Object
-
.pages_path=(filepath) ⇒ Object
Remove leading and trailing ‘/’ characters Will return: “effective/pages”.
- .templates ⇒ Object
Class Method Details
.config_keys ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/effective_pages.rb', line 11 def self.config_keys [ :pages_table_name, :menus_table_name, :menu_items_table_name, :pages_path, :excluded_pages, :excluded_layouts, :site_og_image, :site_title, :site_title_suffix, :fallback_meta_description, :silence_missing_page_title_warnings, :silence_missing_meta_description_warnings, :simple_form_options, :layout, :menu, :acts_as_asset_box ] end |
.layouts ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/effective_pages.rb', line 32 def self.layouts ApplicationController.view_paths.map { |path| Dir["#{path}/layouts/**"] }.flatten.reverse.map do |file| name = File.basename(file).split('.').first next if name.starts_with?('_') next if name.include?('mailer') next if Array(EffectivePages.excluded_layouts).map { |str| str.to_s }.include?(name) name end.compact end |
.pages_path=(filepath) ⇒ Object
Remove leading and trailing ‘/’ characters
Will return: "effective/pages"
44 45 46 47 48 |
# File 'lib/effective_pages.rb', line 44 def self.pages_path=(filepath) filepath = filepath.to_s filepath = filepath[1..-1] if filepath.starts_with?('/') @@pages_path = filepath.chomp('/') end |
.templates ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/effective_pages.rb', line 23 def self.templates ApplicationController.view_paths.map { |path| Dir["#{path}/#{pages_path}/**"] }.flatten.reverse.map do |file| name = File.basename(file).split('.').first next if name.starts_with?('_') next if Array(EffectivePages.excluded_pages).map { |str| str.to_s }.include?(name) name end.compact end |