class Mozzn::Cli

Public Instance Methods

help(command = nil) click to toggle source
Calls superclass method
# File lib/mozzn/cli.rb, line 33
def help command = nil
  puts 'Primary help topics, type "mozzn help COMMAND" for more details.'
  puts "Version: #{Mozzn::VERSION}"
  super command
end
update() click to toggle source
# File lib/mozzn/cli.rb, line 19
def update
  # TODO after gem release https://rubygems.org/api/v1/versions/mozzn.json
  @connection = Faraday.new('https://rubygems.org/api/v1/versions/coulda.json')
  response = @connection.get 
  body = JSON.parse(response.body)
  versions = body.map { |n| n['number'] }
  if Gem::Version.new(versions.last) > Gem::Version.new(Mozzn::VERSION)
    say 'An update is available. To install it run the following command "update gem mozzn"', :yellow
  else
    say 'You have the latest version.', :green
  end
end