Class: ToptranslationCli::Initializer
- Inherits:
-
Object
- Object
- ToptranslationCli::Initializer
- Defined in:
- lib/toptranslation_cli/initializer.rb
Overview
rubocop:disable Metrics/ClassLength
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Initializer
constructor
A new instance of Initializer.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Initializer
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
.run ⇒ Object
10 11 12 |
# File 'lib/toptranslation_cli/initializer.rb', line 10 def run new.run end |
Instance Method Details
#run ⇒ Object
23 24 25 26 |
# File 'lib/toptranslation_cli/initializer.rb', line 23 def run create_config(ask_config) @prompt.ok("Generated #{Configuration::FILENAME}") end |