lib/getv/package.rb in getv-2.1.2 vs lib/getv/package.rb in getv-2.1.3
- old
+ new
@@ -64,10 +64,10 @@
update_versions if opts[:versions].nil?
opts[:versions]
end
def update_versions # rubocop:disable Metrics/PerceivedComplexity,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/AbcSize
- versions = retrieve_versions
+ versions = retrieve_versions || []
versions.sort! if instance_of?(Getv::Package::GitHub::Commit)
select_pattern = Regexp.new(opts[:select_search])
versions.select! { |v| v =~ select_pattern }
versions.map! { |v| v.sub(select_pattern, opts[:select_replace]) }
versions.reject! { |v| v =~ Regexp.new(opts[:reject]) } unless opts[:reject].nil?