Class: Locomotive::Wagon::SyncCommand

Inherits:
Struct
  • Object
show all
Includes:
ApiConcern, DeployFileConcern, InstrumentationConcern, SpinnerConcern
Defined in:
lib/locomotive/wagon/commands/sync_command.rb

Constant Summary collapse

RESOURCES =
%w(site pages content_entries translations).freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SpinnerConcern

#show_wait_spinner

Methods included from InstrumentationConcern

#instrument, #instrument_scope_name

Methods included from DeployFileConcern

#deploy_file, #read_deploy_settings, #write_deploy_settings

Methods included from ApiConcern

#api_client, #api_credentials, #api_host, #api_site_client, #connection_information_from_env_and_path

Instance Attribute Details

#envObject

Returns the value of attribute env

Returns:

  • (Object)

    the current value of env



16
17
18
# File 'lib/locomotive/wagon/commands/sync_command.rb', line 16

def env
  @env
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



16
17
18
# File 'lib/locomotive/wagon/commands/sync_command.rb', line 16

def options
  @options
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



16
17
18
# File 'lib/locomotive/wagon/commands/sync_command.rb', line 16

def path
  @path
end

#shellObject

Returns the value of attribute shell

Returns:

  • (Object)

    the current value of shell



16
17
18
# File 'lib/locomotive/wagon/commands/sync_command.rb', line 16

def shell
  @shell
end

Class Method Details

.sync(env, path, options, shell) ⇒ Object



25
26
27
# File 'lib/locomotive/wagon/commands/sync_command.rb', line 25

def self.sync(env, path, options, shell)
  self.new(env, path, options, shell).sync
end

Instance Method Details

#syncObject



29
30
31
32
33
34
35
36
# File 'lib/locomotive/wagon/commands/sync_command.rb', line 29

def sync
  if options[:verbose]
    SyncLogger.new
    _sync
  else
    show_wait_spinner('Syncing content...') { _sync }
  end
end