Class: Locomotive::Wagon::PullCommand

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

Constant Summary collapse

RESOURCES =
%w(site pages content_types content_entries snippets sections theme_assets translations content_assets).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



14
15
16
# File 'lib/locomotive/wagon/commands/pull_command.rb', line 14

def env
  @env
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



14
15
16
# File 'lib/locomotive/wagon/commands/pull_command.rb', line 14

def options
  @options
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



14
15
16
# File 'lib/locomotive/wagon/commands/pull_command.rb', line 14

def path
  @path
end

#shellObject

Returns the value of attribute shell

Returns:

  • (Object)

    the current value of shell



14
15
16
# File 'lib/locomotive/wagon/commands/pull_command.rb', line 14

def shell
  @shell
end

Class Method Details

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



23
24
25
# File 'lib/locomotive/wagon/commands/pull_command.rb', line 23

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

Instance Method Details

#pullObject



27
28
29
30
31
32
33
34
# File 'lib/locomotive/wagon/commands/pull_command.rb', line 27

def pull
  if options[:verbose]
    PullLogger.new
    _pull
  else
    show_wait_spinner('Pulling...') { _pull }
  end
end