Method: Inspec::InspecCLI#version

Defined in:
lib/inspec/cli.rb

#versionObject



252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/inspec/cli.rb', line 252

def version
  if opts['format'] == 'json'
    v = { version: Inspec::VERSION }
    puts v.to_json
  else
    puts Inspec::VERSION
    # display outdated version
    latest = LatestInSpecVersion.new.latest
    if Gem::Version.new(Inspec::VERSION) < Gem::Version.new(latest)
      puts "\nYour version of InSpec is out of date! The latest version is #{latest}."
    end
  end
end