Method: Inspec::InspecCLI#version

Defined in:
lib/inspec/cli.rb

#versionObject



270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/inspec/cli.rb', line 270

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