Class: ToptranslationCli::Initializer

Inherits:
Object
  • Object
show all
Defined in:
lib/toptranslation_cli/initializer.rb

Overview

rubocop:disable Metrics/ClassLength

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInitializer

Returns a new instance of Initializer.



15
16
17
18
19
20
21
# File 'lib/toptranslation_cli/initializer.rb', line 15

def initialize
  @prompt = TTY::Prompt.new
  @client = ToptranslationCli.connection
  @pastel = Pastel.new
  format = "[#{@pastel.yellow(':spinner')}] :title"
  @spinner = TTY::Spinner.new(format, success_mark: @pastel.green('+'), error_mark: @pastel.red('-'))
end

Class Method Details

.runObject



10
11
12
# File 'lib/toptranslation_cli/initializer.rb', line 10

def run
  new.run
end

Instance Method Details

#runObject



23
24
25
26
# File 'lib/toptranslation_cli/initializer.rb', line 23

def run
  create_config(ask_config)
  @prompt.ok("Generated #{Configuration::FILENAME}")
end