Module: Locomotive

Extended by:
ActiveSupport::Autoload
Defined in:
app/controllers/locomotive/editable_elements_controller.rb,
lib/locomotive.rb,
lib/locomotive/engine.rb,
lib/locomotive/logger.rb,
app/api/locomotive/api.rb,
lib/locomotive/regexps.rb,
lib/locomotive/version.rb,
lib/locomotive/dragonfly.rb,
app/models/locomotive/page.rb,
app/models/locomotive/site.rb,
lib/locomotive/presentable.rb,
lib/locomotive/simple_form.rb,
lib/locomotive/configuration.rb,
app/models/locomotive/account.rb,
app/models/locomotive/section.rb,
app/models/locomotive/snippet.rb,
lib/locomotive/mongoid/liquid.rb,
app/models/locomotive/activity.rb,
app/inputs/locomotive/rte_input.rb,
lib/locomotive/middlewares/site.rb,
lib/locomotive/mongoid/document.rb,
app/inputs/locomotive/code_input.rb,
app/inputs/locomotive/file_input.rb,
app/models/locomotive/membership.rb,
lib/locomotive/carrierwave/asset.rb,
app/inputs/locomotive/array_input.rb,
app/inputs/locomotive/color_input.rb,
app/inputs/locomotive/image_input.rb,
app/models/locomotive/theme_asset.rb,
app/models/locomotive/translation.rb,
app/helpers/locomotive/base_helper.rb,
app/inputs/locomotive/toggle_input.rb,
app/models/locomotive/content_type.rb,
app/helpers/locomotive/pages_helper.rb,
app/helpers/locomotive/sites_helper.rb,
app/inputs/locomotive/api_key_input.rb,
app/inputs/locomotive/locales_input.rb,
app/models/locomotive/content_asset.rb,
app/models/locomotive/content_entry.rb,
app/models/locomotive/editable_file.rb,
app/models/locomotive/editable_text.rb,
app/policies/locomotive/page_policy.rb,
app/policies/locomotive/site_policy.rb,
app/helpers/locomotive/errors_helper.rb,
app/inputs/locomotive/markdown_input.rb,
app/mailers/locomotive/devise_mailer.rb,
app/mailers/locomotive/notifications.rb,
app/models/locomotive/editable_model.rb,
app/services/locomotive/page_service.rb,
app/services/locomotive/site_service.rb,
app/api/locomotive/api/forms/base_form.rb,
app/api/locomotive/api/forms/page_form.rb,
app/api/locomotive/api/forms/site_form.rb,
app/helpers/locomotive/accounts_helper.rb,
app/models/locomotive/editable_control.rb,
app/models/locomotive/editable_element.rb,
app/policies/locomotive/account_policy.rb,
app/policies/locomotive/section_policy.rb,
app/policies/locomotive/snippet_policy.rb,
app/services/locomotive/editor_service.rb,
app/uploaders/locomotive/base_uploader.rb,
app/helpers/locomotive/dashboard_helper.rb,
app/jobs/locomotive/send_pony_email_job.rb,
app/helpers/locomotive/my_account_helper.rb,
app/inputs/locomotive/simple_image_input.rb,
app/models/locomotive/concerns/page/tree.rb,
app/models/locomotive/editable_long_text.rb,
app/api/locomotive/api/exception_rescuers.rb,
app/api/locomotive/api/forms/account_form.rb,
app/api/locomotive/api/forms/section_form.rb,
app/api/locomotive/api/forms/snippet_form.rb,
app/helpers/locomotive/memberships_helper.rb,
app/models/locomotive/concerns/shared/seo.rb,
app/models/locomotive/concerns/site/cache.rb,
app/models/locomotive/editable_short_text.rb,
app/policies/locomotive/membership_policy.rb,
app/services/locomotive/page_tree_service.rb,
app/uploaders/locomotive/picture_uploader.rb,
app/controllers/locomotive/base_controller.rb,
app/helpers/locomotive/page_content_helper.rb,
app/helpers/locomotive/shared/pages_helper.rb,
app/helpers/locomotive/shared/sites_helper.rb,
app/helpers/locomotive/translations_helper.rb,
app/models/locomotive/concerns/asset/types.rb,
app/models/locomotive/concerns/page/layout.rb,
app/models/locomotive/concerns/page/listed.rb,
app/models/locomotive/concerns/shared/slug.rb,
app/models/locomotive/concerns/site/routes.rb,
app/policies/locomotive/application_policy.rb,
app/policies/locomotive/theme_asset_policy.rb,
app/policies/locomotive/translation_policy.rb,
app/services/locomotive/membership_service.rb,
lib/locomotive/action_controller/responder.rb,
lib/locomotive/middlewares/image_thumbnail.rb,
app/api/locomotive/api/entities/base_entity.rb,
app/api/locomotive/api/entities/page_entity.rb,
app/api/locomotive/api/entities/site_entity.rb,
app/controllers/locomotive/pages_controller.rb,
app/controllers/locomotive/sites_controller.rb,
app/helpers/locomotive/content_types_helper.rb,
app/helpers/locomotive/custom_fields_helper.rb,
app/inputs/locomotive/document_picker_input.rb,
app/inputs/locomotive/editable_select_input.rb,
app/models/locomotive/concerns/site/locales.rb,
app/policies/locomotive/content_type_policy.rb,
app/services/locomotive/translation_service.rb,
app/api/locomotive/api/forms/membership_form.rb,
app/api/locomotive/api/forms/my_account_form.rb,
app/api/locomotive/api/helpers/params_helper.rb,
app/controllers/locomotive/errors_controller.rb,
app/helpers/locomotive/content_assets_helper.rb,
app/models/locomotive/concerns/page/redirect.rb,
app/models/locomotive/concerns/page/sections.rb,
app/models/locomotive/concerns/page/to_steam.rb,
app/models/locomotive/concerns/site/sections.rb,
app/models/locomotive/concerns/site/timezone.rb,
app/policies/locomotive/content_asset_policy.rb,
app/policies/locomotive/content_entry_policy.rb,
app/services/locomotive/content_type_service.rb,
app/services/locomotive/custom_field_service.rb,
app/services/locomotive/page_parsing_service.rb,
lib/locomotive/steam/middlewares/catch_error.rb,
app/api/locomotive/api/forms/theme_asset_form.rb,
app/api/locomotive/api/forms/translation_form.rb,
app/api/locomotive/api/helpers/locales_helper.rb,
app/helpers/locomotive/content_entries_helper.rb,
app/helpers/locomotive/shared/accounts_helper.rb,
app/models/locomotive/concerns/asset/checksum.rb,
app/models/locomotive/concerns/asset/vignette.rb,
app/services/locomotive/content_asset_service.rb,
app/services/locomotive/content_entry_service.rb,
app/uploaders/locomotive/theme_asset_uploader.rb,
lib/locomotive/steam/middlewares/page_editing.rb,
lib/locomotive/steam/middlewares/wysihtml_css.rb,
app/api/locomotive/api/entities/account_entity.rb,
app/api/locomotive/api/entities/section_entity.rb,
app/api/locomotive/api/entities/snippet_entity.rb,
app/api/locomotive/api/forms/content_type_form.rb,
app/api/locomotive/api/resources/page_resource.rb,
app/api/locomotive/api/resources/site_resource.rb,
app/controllers/locomotive/accounts_controller.rb,
app/controllers/locomotive/sessions_controller.rb,
app/models/locomotive/concerns/account/api_key.rb,
app/models/locomotive/concerns/site/metafields.rb,
app/api/locomotive/api/forms/content_asset_form.rb,
app/api/locomotive/api/forms/content_entry_form.rb,
app/api/locomotive/api/resources/token_resource.rb,
app/controllers/locomotive/dashboard_controller.rb,
app/controllers/locomotive/passwords_controller.rb,
app/helpers/locomotive/editable_elements_helper.rb,
app/helpers/locomotive/shared/activities_helper.rb,
app/models/locomotive/concerns/page/templatized.rb,
app/models/locomotive/concerns/shared/userstamp.rb,
app/services/locomotive/site_metafields_service.rb,
app/uploaders/locomotive/content_asset_uploader.rb,
app/uploaders/locomotive/editable_file_uploader.rb,
lib/locomotive/dragonfly/processors/smart_thumb.rb,
app/api/locomotive/api/helpers/pagination_helper.rb,
app/controllers/locomotive/my_account_controller.rb,
app/models/locomotive/concerns/content_entry/csv.rb,
app/models/locomotive/concerns/content_type/sync.rb,
app/models/locomotive/concerns/shared/site_scope.rb,
app/services/locomotive/editable_element_service.rb,
app/api/locomotive/api/entities/membership_entity.rb,
app/api/locomotive/api/helpers/persistence_helper.rb,
app/api/locomotive/api/resources/account_resource.rb,
app/api/locomotive/api/resources/section_resource.rb,
app/api/locomotive/api/resources/snippet_resource.rb,
app/api/locomotive/api/resources/version_resource.rb,
app/controllers/locomotive/memberships_controller.rb,
app/models/locomotive/concerns/content_entry/slug.rb,
app/models/locomotive/concerns/content_type/label.rb,
app/models/locomotive/concerns/site/access_points.rb,
app/services/locomotive/concerns/activity_service.rb,
lib/locomotive/steam/services/async_email_service.rb,
app/api/locomotive/api/entities/theme_asset_entity.rb,
app/api/locomotive/api/entities/translation_entity.rb,
app/api/locomotive/api/forms/editable_element_form.rb,
app/controllers/locomotive/concerns/ssl_controller.rb,
app/controllers/locomotive/current_site_controller.rb,
app/controllers/locomotive/page_content_controller.rb,
app/controllers/locomotive/translations_controller.rb,
app/models/locomotive/concerns/site/private_access.rb,
app/api/locomotive/api/entities/content_type_entity.rb,
app/controllers/locomotive/registrations_controller.rb,
app/services/locomotive/custom_field_finder_service.rb,
lib/generators/locomotive/install/install_generator.rb,
lib/locomotive/middlewares/custom_public_exceptions.rb,
app/api/locomotive/api/entities/content_asset_entity.rb,
app/api/locomotive/api/entities/content_entry_entity.rb,
app/api/locomotive/api/forms/content_type_field_form.rb,
app/api/locomotive/api/helpers/authentication_helper.rb,
app/api/locomotive/api/middlewares/locale_middleware.rb,
app/api/locomotive/api/middlewares/logger_middleware.rb,
app/api/locomotive/api/resources/membership_resource.rb,
app/api/locomotive/api/resources/my_account_resource.rb,
app/controllers/locomotive/content_assets_controller.rb,
app/helpers/locomotive/shared/site_metafields_helper.rb,
app/models/locomotive/concerns/content_entry/counter.rb,
app/models/locomotive/concerns/content_type/group_by.rb,
app/models/locomotive/concerns/content_type/order_by.rb,
app/models/locomotive/concerns/shared/json_attribute.rb,
app/models/locomotive/concerns/site/url_redirections.rb,
app/api/locomotive/api/resources/theme_asset_resource.rb,
app/api/locomotive/api/resources/translation_resource.rb,
app/controllers/locomotive/content_entries_controller.rb,
app/helpers/locomotive/current_site_metafields_helper.rb,
app/models/locomotive/concerns/page/editable_elements.rb,
lib/locomotive/steam/middlewares/missing_translations.rb,
app/api/locomotive/api/resources/content_type_resource.rb,
app/api/locomotive/api/resources/current_site_resource.rb,
app/controllers/locomotive/concerns/account_controller.rb,
app/helpers/locomotive/developers_documentation_helper.rb,
app/models/locomotive/concerns/content_entry/file_size.rb,
app/models/locomotive/concerns/content_entry/localized.rb,
app/api/locomotive/api/entities/editable_element_entity.rb,
app/api/locomotive/api/resources/content_asset_resource.rb,
app/api/locomotive/api/resources/content_entry_resource.rb,
app/controllers/locomotive/concerns/timezone_controller.rb,
lib/locomotive/steam/services/api_content_entry_service.rb,
app/controllers/locomotive/concerns/exception_controller.rb,
app/helpers/locomotive/public_submission_accounts_helper.rb,
app/api/locomotive/api/entities/content_type_field_entity.rb,
app/api/locomotive/api/resources/url_redirection_resource.rb,
app/controllers/locomotive/concerns/membership_controller.rb,
app/models/locomotive/concerns/content_type/class_helpers.rb,
app/models/locomotive/concerns/content_type/filter_fields.rb,
app/controllers/locomotive/concerns/within_site_controller.rb,
app/controllers/locomotive/search_for_resources_controller.rb,
app/models/locomotive/concerns/content_entry/next_previous.rb,
app/models/locomotive/concerns/content_type/default_values.rb,
app/models/locomotive/concerns/content_type/entry_template.rb,
lib/locomotive/steam/services/api_entry_submission_service.rb,
app/models/locomotive/concerns/content_entry/authentication.rb,
app/api/locomotive/api/middlewares/params_decoder_middleware.rb,
app/controllers/locomotive/concerns/authorization_controller.rb,
app/controllers/locomotive/concerns/locale_helpers_controller.rb,
app/controllers/locomotive/concerns/store_location_controller.rb,
app/controllers/locomotive/current_site_metafields_controller.rb,
app/controllers/locomotive/concerns/site_dispatcher_controller.rb,
app/controllers/locomotive/developers_documentation_controller.rb,
lib/locomotive/steam/services/liquid_parser_with_cache_service.rb,
app/controllers/locomotive/public_submission_accounts_controller.rb,
app/controllers/locomotive/content_entry_impersonations_controller.rb,
app/controllers/locomotive/custom_fields/select_options_controller.rb,
app/controllers/locomotive/concerns/token_authentication_controller.rb,
app/controllers/locomotive/concerns/redirect_to_main_host_controller.rb,
app/models/locomotive/concerns/content_type/public_submission_title_template.rb

Overview

Defined Under Namespace

Modules: API, AccountsHelper, ActionController, BaseHelper, CarrierWave, Concerns, ContentAssetsHelper, ContentEntriesHelper, ContentTypesHelper, CurrentSiteMetafieldsHelper, CustomFields, CustomFieldsHelper, DashboardHelper, DevelopersDocumentationHelper, Dragonfly, EditableElementsHelper, ErrorsHelper, Logger, MembershipsHelper, Middlewares, Mongoid, MyAccountHelper, PageContentHelper, PagesHelper, Presentable, PublicSubmissionAccountsHelper, Regexps, Shared, SimpleForm, SitesHelper, Steam, TranslationsHelper Classes: Account, AccountPolicy, AccountsController, Activity, ApiKeyInput, ApplicationPolicy, ArrayInput, BaseController, BaseUploader, CodeInput, ColorInput, Configuration, ConfigurationHash, ContentAsset, ContentAssetPolicy, ContentAssetService, ContentAssetUploader, ContentAssetsController, ContentEntriesController, ContentEntry, ContentEntryImpersonationsController, ContentEntryPolicy, ContentEntryService, ContentType, ContentTypePolicy, ContentTypeService, CurrentSiteController, CurrentSiteMetafieldsController, CustomFieldFinderService, CustomFieldService, DashboardController, DevelopersDocumentationController, DeviseMailer, DocumentPickerInput, EditableControl, EditableElement, EditableElementService, EditableElementsController, EditableFile, EditableFileUploader, EditableLongText, EditableModel, EditableSelectInput, EditableShortText, EditableText, EditorService, Engine, ErrorsController, FileInput, FormBuilder, ImageInput, ImageResizeForm, InstallGenerator, LocalesInput, MarkdownInput, Membership, MembershipPolicy, MembershipService, MembershipsController, MyAccountController, Notifications, Page, PageContentController, PageParsingService, PagePolicy, PageService, PageTreeService, PagesController, PasswordsController, PictureUploader, PublicSubmissionAccountsController, RegistrationsController, RteInput, SearchForResourcesController, Section, SectionPolicy, SendPonyEmailJob, SessionsController, SimpleImageInput, Site, SiteMetafieldsService, SitePolicy, SiteService, SitesController, Snippet, SnippetPolicy, ThemeAsset, ThemeAssetPolicy, ThemeAssetUploader, ToggleInput, Translation, TranslationPolicy, TranslationService, TranslationsController

Constant Summary collapse

VERSION =
'4.0.3'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Returns the value of attribute config


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

def config
  @config
end

Class Method Details

.after_configureObject


40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/locomotive.rb', line 40

def self.after_configure
  # Devise
  mail_address = self.config.mailer_sender
  ::Devise.mailer_sender = mail_address =~ /[email protected]+/ ? mail_address : "#{mail_address}@#{Locomotive.config.domain}"

  # Check for outdated Dragonfly config
  if ::Dragonfly::VERSION =~ /^0\.9\.([0-9]+)/
    Locomotive.log :error, "WARNING: Old Dragonfly config detected, image uploads might be broken. Use 'rails g locomotive:install' to get the latest configuration files."
  end

  # avoid I18n warnings
  I18n.enforce_available_locales = false
end

.configure {|self.config| ... } ⇒ Object

Yields:


32
33
34
35
36
37
38
# File 'lib/locomotive.rb', line 32

def self.configure
  self.config ||= Configuration.new

  yield(self.config)

  after_configure
end

.log(*args) ⇒ Object


54
55
56
57
58
59
# File 'lib/locomotive.rb', line 54

def self.log(*args)
  level   = args.size == 1 ? 'info' : args.first
  message = args.size == 1 ? args.first : args.last

  ::Locomotive::Logger.send(level.to_sym, message)
end

.mounted_onObject


61
62
63
# File 'lib/locomotive.rb', line 61

def self.mounted_on
  Rails.application.routes.named_routes[:locomotive].path.spec.to_s
end