Method: Inspec::InspecCLI#version

Defined in:
lib/inspec/cli.rb

#versionObject



235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/inspec/cli.rb', line 235

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