Module: Locomotive::Wagon
- Defined in:
- lib/locomotive/wagon.rb,
lib/locomotive/wagon/cli.rb,
lib/locomotive/wagon/version.rb,
lib/locomotive/wagon/exceptions.rb,
lib/locomotive/wagon/tools/glob.rb,
lib/locomotive/wagon/tools/listen.rb,
lib/locomotive/wagon/tools/tcp_port.rb,
lib/locomotive/wagon/tools/yaml_ext.rb,
lib/locomotive/wagon/generators/page.rb,
lib/locomotive/wagon/generators/site.rb,
lib/locomotive/wagon/generators/section.rb,
lib/locomotive/wagon/generators/snippet.rb,
lib/locomotive/wagon/generators/webpack.rb,
lib/locomotive/wagon/generators/site/base.rb,
lib/locomotive/wagon/commands/init_command.rb,
lib/locomotive/wagon/commands/pull_command.rb,
lib/locomotive/wagon/commands/push_command.rb,
lib/locomotive/wagon/commands/sync_command.rb,
lib/locomotive/wagon/generators/site/blank.rb,
lib/locomotive/wagon/commands/clone_command.rb,
lib/locomotive/wagon/commands/serve_command.rb,
lib/locomotive/wagon/generators/public_form.rb,
lib/locomotive/wagon/generators/site/cloned.rb,
lib/locomotive/wagon/middlewares/error_page.rb,
lib/locomotive/wagon/commands/delete_command.rb,
lib/locomotive/wagon/generators/content_type.rb,
lib/locomotive/wagon/generators/relationship.rb,
lib/locomotive/wagon/commands/generate_command.rb,
lib/locomotive/wagon/decorators/page_decorator.rb,
lib/locomotive/wagon/decorators/site_decorator.rb,
lib/locomotive/wagon/generators/site_metafields.rb,
lib/locomotive/wagon/commands/loggers/base_logger.rb,
lib/locomotive/wagon/commands/loggers/pull_logger.rb,
lib/locomotive/wagon/commands/loggers/push_logger.rb,
lib/locomotive/wagon/commands/loggers/sync_logger.rb,
lib/locomotive/wagon/decorators/section_decorator.rb,
lib/locomotive/wagon/decorators/snippet_decorator.rb,
lib/locomotive/wagon/commands/authenticate_command.rb,
lib/locomotive/wagon/commands/concerns/api_concern.rb,
lib/locomotive/wagon/commands/concerns/netrc_concern.rb,
lib/locomotive/wagon/commands/concerns/steam_concern.rb,
lib/locomotive/wagon/decorators/theme_asset_decorator.rb,
lib/locomotive/wagon/decorators/translation_decorator.rb,
lib/locomotive/wagon/commands/concerns/spinner_concern.rb,
lib/locomotive/wagon/decorators/content_type_decorator.rb,
lib/locomotive/wagon/decorators/content_asset_decorator.rb,
lib/locomotive/wagon/decorators/content_entry_decorator.rb,
lib/locomotive/wagon/decorators/concerns/to_hash_concern.rb,
lib/locomotive/wagon/commands/concerns/deploy_file_concern.rb,
lib/locomotive/wagon/decorators/editable_element_decorator.rb,
lib/locomotive/wagon/decorators/content_type_field_decorator.rb,
lib/locomotive/wagon/commands/concerns/instrumentation_concern.rb,
lib/locomotive/wagon/decorators/concerns/persist_assets_concern.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_base_command.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_site_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_base_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_site_command.rb,
lib/locomotive/wagon/commands/sync_sub_commands/sync_site_command.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_pages_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_pages_command.rb,
lib/locomotive/wagon/commands/sync_sub_commands/sync_pages_command.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_sections_command.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_snippets_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_sections_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_snippets_command.rb,
lib/locomotive/wagon/commands/sync_sub_commands/concerns/base_concern.rb,
lib/locomotive/wagon/commands/pull_sub_commands/concerns/assets_concern.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_theme_assets_command.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_translations_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_theme_assets_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_translations_command.rb,
lib/locomotive/wagon/commands/sync_sub_commands/sync_translations_command.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_content_types_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_content_types_command.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_content_assets_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_content_assets_command.rb,
lib/locomotive/wagon/commands/pull_sub_commands/pull_content_entries_command.rb,
lib/locomotive/wagon/commands/push_sub_commands/push_content_entries_command.rb,
lib/locomotive/wagon/commands/sync_sub_commands/sync_content_entries_command.rb
Defined Under Namespace
Modules: ApiConcern, AssetsConcern, BaseConcern, CLI, DeployFileConcern, Generators, InstrumentationConcern, Middlewares, NetrcConcern, PersistAssetsConcern, SpinnerConcern, SteamConcern, ToHashConcern, YamlExt Classes: AuthenticateCommand, BaseLogger, CloneCommand, ContentAssetDecorator, ContentEntryDecorator, ContentEntryWithLocalizedAttributesDecorator, ContentEntryWithOnlyRelationshipsDecorator, ContentTypeDecorator, ContentTypeFieldDecorator, ContentTypeWithOnlyRelationshipsDecorator, DeleteCommand, EditableElementDecorator, GenerateCommand, GeneratorException, Glob, InitCommand, Listen, PageDecorator, PullBaseCommand, PullCommand, PullContentAssetsCommand, PullContentEntriesCommand, PullContentTypesCommand, PullLogger, PullPagesCommand, PullSectionsCommand, PullSiteCommand, PullSnippetsCommand, PullThemeAssetsCommand, PullTranslationsCommand, PushBaseCommand, PushCommand, PushContentAssetsCommand, PushContentEntriesCommand, PushContentTypesCommand, PushLogger, PushPagesCommand, PushSectionsCommand, PushSiteCommand, PushSnippetsCommand, PushThemeAssetsCommand, PushTranslationsCommand, RemoteSiteDecorator, SectionDecorator, ServeCommand, SiteDecorator, SiteFinder, SnippetDecorator, SyncCommand, SyncContentEntriesCommand, SyncLogger, SyncPagesCommand, SyncSiteCommand, SyncTranslationsCommand, TcpPort, ThemeAssetDecorator, TranslationDecorator, UpdateSiteDecorator
Constant Summary collapse
- DEFAULT_PLATFORM_URL =
'https://station.locomotive.works'.freeze
- VERSION =
'3.2.0.alpha2'
Class Method Summary collapse
-
.authenticate(url, email, password, shell) ⇒ Object
Authenticate an user to the Hosting platform.
-
.clone(name, path, options, shell) ⇒ Object
Clone a site from a remote LocomotiveCMS engine.
-
.delete(env, path, resource, slug, shell) ⇒ Object
Delete one or all remote resource(s).
-
.generate(name, args, options = {}) ⇒ Object
Generate components for the LocomotiveCMS site such as content types, snippets, pages.
-
.init(generator_klass, args, options = {}) ⇒ Object
Create a site from a site generator.
-
.pull(env, path, options = {}, shell) ⇒ Object
Pull a site from a remote LocomotiveCMS engine described by the config/deploy.yml file of the site and for a specific environment.
-
.push(env, path, options = {}, shell) ⇒ Object
Push a site to a remote LocomotiveCMS engine described by the config/deploy.yml file of the site and for a specific environment.
- .require_misc_gems ⇒ Object
-
.serve(path, options, shell) ⇒ Object
Start the thin server which serves the LocomotiveCMS site from the system.
-
.stop(path, force = false, shell) ⇒ Object
Stop the thin server.
-
.sync(env, path, options = {}, shell) ⇒ Object
Synchronize the local content with the one from a remote Locomotive engine.
Class Method Details
.authenticate(url, email, password, shell) ⇒ Object
Authenticate an user to the Hosting platform. If the user does not exist, then create an account for her/him. At the end, store the API key in the ~/.netrc file
17 18 19 20 |
# File 'lib/locomotive/wagon.rb', line 17 def self.authenticate(url, email, password, shell) require_relative 'wagon/commands/authenticate_command' Locomotive::Wagon::AuthenticateCommand.authenticate(url, email, password, shell) end |
.clone(name, path, options, shell) ⇒ Object
Clone a site from a remote LocomotiveCMS engine.
108 109 110 111 |
# File 'lib/locomotive/wagon.rb', line 108 def self.clone(name, path, , shell) require_relative 'wagon/commands/clone_command' Locomotive::Wagon::CloneCommand.clone(name, path, , shell) end |
.delete(env, path, resource, slug, shell) ⇒ Object
Delete one or all remote resource(s)
119 120 121 122 |
# File 'lib/locomotive/wagon.rb', line 119 def self.delete(env, path, resource, slug, shell) require_relative 'wagon/commands/delete_command' Locomotive::Wagon::DeleteCommand.delete(env, path, resource, slug, shell) end |
.generate(name, args, options = {}) ⇒ Object
Generate components for the LocomotiveCMS site such as content types, snippets, pages.
59 60 61 62 |
# File 'lib/locomotive/wagon.rb', line 59 def self.generate(name, args, = {}) require_relative 'wagon/commands/generate_command' Locomotive::Wagon::GenerateCommand.generate(name, args, ) end |
.init(generator_klass, args, options = {}) ⇒ Object
Create a site from a site generator.
28 29 30 31 |
# File 'lib/locomotive/wagon.rb', line 28 def self.init(generator_klass, args, = {}) require_relative 'wagon/commands/init_command' Locomotive::Wagon::InitCommand.generate(generator_klass, args, ) end |
.pull(env, path, options = {}, shell) ⇒ Object
Pull a site from a remote LocomotiveCMS engine described by the config/deploy.yml file of the site and for a specific environment.
84 85 86 87 |
# File 'lib/locomotive/wagon.rb', line 84 def self.pull(env, path, = {}, shell) require_relative 'wagon/commands/pull_command' Locomotive::Wagon::PullCommand.pull(env, path, , shell) end |
.push(env, path, options = {}, shell) ⇒ Object
Push a site to a remote LocomotiveCMS engine described by the config/deploy.yml file of the site and for a specific environment.
72 73 74 75 |
# File 'lib/locomotive/wagon.rb', line 72 def self.push(env, path, = {}, shell) require_relative 'wagon/commands/push_command' Locomotive::Wagon::PushCommand.push(env, path, , shell) end |
.require_misc_gems ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/locomotive/wagon.rb', line 124 def self.require_misc_gems return if ENV['WAGON_GEMFILE'].nil? # at this point, we are sure that in a bundle exec contact begin require 'bundler' ::Bundler.require(:misc) rescue Exception => e puts "Warning: cant' require the Gemfile misc group, reason: #{e.}" # Bundler is not defined or there is an issue # with one of the gems in the misc group end end |
.serve(path, options, shell) ⇒ Object
Start the thin server which serves the LocomotiveCMS site from the system.
38 39 40 41 |
# File 'lib/locomotive/wagon.rb', line 38 def self.serve(path, , shell) require_relative 'wagon/commands/serve_command' Locomotive::Wagon::ServeCommand.start(path, , shell) end |
.stop(path, force = false, shell) ⇒ Object
Stop the thin server.
48 49 50 51 |
# File 'lib/locomotive/wagon.rb', line 48 def self.stop(path, force = false, shell) require_relative 'wagon/commands/serve_command' Locomotive::Wagon::ServeCommand.stop(path, force, shell) end |
.sync(env, path, options = {}, shell) ⇒ Object
Synchronize the local content with the one from a remote Locomotive engine. by the config/deploy.yml file of the site and for a specific environment.
96 97 98 99 |
# File 'lib/locomotive/wagon.rb', line 96 def self.sync(env, path, = {}, shell) require_relative 'wagon/commands/sync_command' Locomotive::Wagon::SyncCommand.sync(env, path, , shell) end |