Class: Gitloggl::Commands::Update

Inherits:
Gitloggl::Command show all
Defined in:
lib/gitloggl/commands/update.rb

Constant Summary collapse

RUBYGEMS_URL =
'https://rubygems.org/api/v1/gems/gitloggl.json'

Instance Attribute Summary

Attributes inherited from Gitloggl::Command

#back, #options

Instance Method Summary collapse

Methods inherited from Gitloggl::Command

#back?, #capture_back, #command, #config, #cursor, #editor, #exec_exist?, #generator, #initialize, #menu_back, #pager, #pastel, #platform, #prompt, #render_table, #screen, #verbose?, #which

Constructor Details

This class inherits a constructor from Gitloggl::Command

Instance Method Details

#executeObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gitloggl/commands/update.rb', line 8

def execute
  spinner = TTY::Spinner.new("[:spinner] Loading ...", format: :pulse_2)
  outdated = outdated?(parse_version(VERSION), parse_version(remote_version))
  spinner.stop

  unless outdated
    puts pastel.yellow('No Updates Available')
    return back.call
  end

  select_update
end