Class: Wordmove::EnvironmentsList

Inherits:
Object
  • Object
show all
Defined in:
lib/wordmove/environments_list.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ EnvironmentsList

Returns a new instance of EnvironmentsList.



11
12
13
14
15
16
# File 'lib/wordmove/environments_list.rb', line 11

def initialize(options)
  @logger = Logger.new(STDOUT).tap { |l| l.level = Logger::INFO }
  @movefile = Wordmove::Movefile.new(options[:config])
  @remote_vhosts = []
  @local_vhost = []
end

Instance Attribute Details

#local_vhostObject (readonly)

Returns the value of attribute local_vhost.



3
4
5
# File 'lib/wordmove/environments_list.rb', line 3

def local_vhost
  @local_vhost
end

#loggerObject (readonly)

Returns the value of attribute logger.



3
4
5
# File 'lib/wordmove/environments_list.rb', line 3

def logger
  @logger
end

#movefileObject (readonly)

Returns the value of attribute movefile.



3
4
5
# File 'lib/wordmove/environments_list.rb', line 3

def movefile
  @movefile
end

#remote_vhostsObject (readonly)

Returns the value of attribute remote_vhosts.



3
4
5
# File 'lib/wordmove/environments_list.rb', line 3

def remote_vhosts
  @remote_vhosts
end

Class Method Details



6
7
8
# File 'lib/wordmove/environments_list.rb', line 6

def print(cli_options)
  new(cli_options).print
end

Instance Method Details



18
19
20
21
22
# File 'lib/wordmove/environments_list.rb', line 18

def print
  contents = parse_movefile(movefile: movefile)
  generate_vhost_list(contents: contents)
  output
end