Class: Localeapp::CLI::Install

Inherits:
Command
  • Object
show all
Defined in:
lib/localeapp/cli/install.rb

Defined Under Namespace

Classes: DefaultInstaller, GithubInstaller, HerokuInstaller, StandaloneInstaller

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#initialize_config, #load_config_file, #set_command_line_arguments

Constructor Details

#initialize(args = {}) ⇒ Install

Returns a new instance of Install.



6
7
8
9
# File 'lib/localeapp/cli/install.rb', line 6

def initialize(args = {})
  super
  @config_type = :default
end

Instance Attribute Details

#config_typeObject

Returns the value of attribute config_type.



4
5
6
# File 'lib/localeapp/cli/install.rb', line 4

def config_type
  @config_type
end

Instance Method Details

#execute(key = nil, **options) ⇒ Object



11
12
13
14
# File 'lib/localeapp/cli/install.rb', line 11

def execute(key = nil, **options)
  installer("#{config_type.to_s.capitalize}Installer")
    .execute key, options
end

#installer(installer_class) ⇒ Object



16
17
18
# File 'lib/localeapp/cli/install.rb', line 16

def installer(installer_class)
  self.class.const_get(installer_class).new(@output)
end