Class: TempestTime::Commands::Setup

Inherits:
TempestTime::Command show all
Defined in:
lib/tempest_time/commands/setup.rb

Instance Method Summary collapse

Methods inherited from TempestTime::Command

#command, #date_prompt, #execute, #pastel, #prompt, #spinner, #table, #week_prompt, #with_spinner, #with_success_fail_spinner

Methods included from Helpers::GitHelper

#automatic_issue

Methods included from Helpers::FormattingHelper

#braced, #with_percent_sign

Methods included from Helpers::TimeHelper

#beginning_of_week, #dates_in_range, #end_of_week, #formatted_date, #formatted_date_range, #formatted_time, #formatted_time_for_input, #formatted_time_long, #future_dates, #parsed_time, #past_dates, #past_week_selections, #week_beginnings, #week_dates

Constructor Details

#initialize(options) ⇒ Setup

Returns a new instance of Setup.



12
13
14
# File 'lib/tempest_time/commands/setup.rb', line 12

def initialize(options)
  @options = options
end

Instance Method Details

#execute!Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/tempest_time/commands/setup.rb', line 16

def execute!
  check_for_completion
  set_authorization_values
  set_app_settings
  with_spinner('Checking credentials...') do |spinner|
    begin
      check_for_validity
      spinner.stop(pastel.green("Success! You're ready to go!"))
    rescue StandardError
      spinner.stop(
        pastel.red("Something isn't right... please re-run setup.")
      )
    end
  end
end