Sha256: 4ac97d79213dca678e60085067677c52b9fde346dd775adb52d7c150da0dc5e2

Contents?: true

Size: 707 Bytes

Versions: 3

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

module NeetoCompliance
  class GemsVerifierBase < Base
    def gems
      []
    end

    def latest_versions
      @_latest_versions ||= _latest_versions
    end

    def _latest_versions
      JSON.parse(Net::HTTP.get_response(URI("https://neeto-library-stable-versions.herokuapp.com/versions")).body)
    end

    def valid?
      @failed_gems = []

      gems.map do |gem|
        gv = GemVersionVerifier.new(gem[:name], gem[:repo], latest_versions[gem[:repo]])
        unless gv.valid?
          @failed_gems << gem[:name]
        end
      end

      @failed_gems.empty?
    end

    def autofix_command
      "bundle update #{@failed_gems.join(' ')}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
neetob-0.1.2 neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb
neetob-0.1.1 /Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb
neetob-0.1.0 /Users/chiragshah/Workspace/bigbinary/neeto/neetob/neeto_compliance/lib/neeto_compliance/verifiers/gems_verifier_base.rb