Class: LatestInSpecVersion
- Inherits:
-
Object
- Object
- LatestInSpecVersion
- Defined in:
- lib/inspec/utils/latest_version.rb
Instance Method Summary collapse
-
#latest ⇒ Object
fetches the latest version from rubygems server.
Instance Method Details
#latest ⇒ Object
fetches the latest version from rubygems server
6 7 8 9 10 11 12 |
# File 'lib/inspec/utils/latest_version.rb', line 6 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 |