Class: Locomotive::Wagon::CloneCommand

Inherits:
Struct
  • Object
show all
Defined in:
lib/locomotive/wagon/commands/clone_command.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/locomotive/wagon/commands/clone_command.rb', line 6

def name
  @name
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



6
7
8
# File 'lib/locomotive/wagon/commands/clone_command.rb', line 6

def options
  @options
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



6
7
8
# File 'lib/locomotive/wagon/commands/clone_command.rb', line 6

def path
  @path
end

#shellObject

Returns the value of attribute shell

Returns:

  • (Object)

    the current value of shell



6
7
8
# File 'lib/locomotive/wagon/commands/clone_command.rb', line 6

def shell
  @shell
end

Class Method Details

.clone(name, path, options, shell) ⇒ Object



8
9
10
# File 'lib/locomotive/wagon/commands/clone_command.rb', line 8

def self.clone(name, path, options, shell)
  new(name, path, options, shell).clone
end

Instance Method Details

#cloneObject



12
13
14
15
16
17
18
# File 'lib/locomotive/wagon/commands/clone_command.rb', line 12

def clone
  # create an empty site with the minimal settings
  create_site

  # pull the pages, content_types, basically any resources from the remote site
  pull_site
end

#connection_infoObject



20
21
22
# File 'lib/locomotive/wagon/commands/clone_command.rb', line 20

def connection_info
  options.symbolize_keys.slice(:host, :handle, :email, :api_key, :password)
end