Sha256: eb69ede21955297b5fcc6e8a7dab67cc739fcd564c21aacdc83535062ae4bdda

Contents?: true

Size: 333 Bytes

Versions: 12

Compression:

Stored size: 333 Bytes

Contents

require "json"
require "open-uri"

class LatestInSpecVersion
  # fetches the latest version from rubygems server
  def latest
    uri = URI("https://rubygems.org/api/v1/gems/inspec.json")
    inspec_info = JSON.parse(uri.read(open_timeout: 1.5, read_timeout: 1.5))
    inspec_info["version"]
  rescue StandardError
    nil
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
inspec-core-4.7.24 lib/inspec/utils/latest_version.rb
inspec-4.7.24 lib/inspec/utils/latest_version.rb
inspec-core-4.7.18 lib/inspec/utils/latest_version.rb
inspec-4.7.18 lib/inspec/utils/latest_version.rb
inspec-core-4.7.3 lib/inspec/utils/latest_version.rb
inspec-4.7.3 lib/inspec/utils/latest_version.rb
inspec-core-4.6.9 lib/inspec/utils/latest_version.rb
inspec-4.6.9 lib/inspec/utils/latest_version.rb
inspec-core-4.6.4 lib/inspec/utils/latest_version.rb
inspec-4.6.4 lib/inspec/utils/latest_version.rb
inspec-core-4.6.3 lib/inspec/utils/latest_version.rb
inspec-4.6.3 lib/inspec/utils/latest_version.rb