Method: PythonLang.latest_version
- Defined in:
- lib/cutting_edge/langs/python.rb
.latest_version(name) ⇒ Object
Find the latest versions of a dependency by name
name - String name of the dependency
Returns a Gem::Version
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/cutting_edge/langs/python.rb', line 74 def latest_version(name) begin content = HTTP.timeout(::CuttingEdge::LAST_VERSION_TIMEOUT).follow(max_hops: 1).get(::File.join(API_URL, name, 'json')).parse version = content['info']['version'] Gem::Version.new(canonical_version(version)) rescue StandardError, HTTP::TimeoutError => e log_error("Encountered error when fetching latest version of #{name}: #{e.class} #{e.message}") nil end end |