Sha256: 429f932442d212048bdc71ebeb3b1dd238befdf51073c96258b753ad5ac7284b
Contents?: true
Size: 795 Bytes
Versions: 9
Compression:
Stored size: 795 Bytes
Contents
# frozen_string_literal: true module MuxTf module VersionCheck def has_updates? # rubocop:disable Naming/PredicateName current_gem_version < latest_gem_version end def latest_gem_version value = cache.fetch("latest_gem_version") { fetcher = Gem::SpecFetcher.fetcher dependency = Gem::Dependency.new "mux_tf" remotes, = fetcher.search_for_dependency dependency remotes.map(&:first).map(&:version).max.to_s } Gem::Version.new(value) end def current_gem_version Gem::Version.new(MuxTf::VERSION) end def cache @cache ||= YamlCache.new(File.expand_path("~/.mux_tf.yaml"), default_ttl: 1.hour) end module_function :has_updates?, :latest_gem_version, :current_gem_version, :cache end end
Version data entries
9 entries across 9 versions & 1 rubygems