Sha256: 862d39509be1fbeb8612149f7e6a098100a8d0a2d56bc608b0bdf93d5aa80a3d

Contents?: true

Size: 614 Bytes

Versions: 2

Compression:

Stored size: 614 Bytes

Contents

# frozen_string_literal: true

module OhlohScm
  module Git
    class Validation < OhlohScm::Validation
      def validate
        super
        @errors << [:branch_name, 'Invalid Branch Name.'] if scm.branch_name.to_s.empty?
      end

      private

      def validate_server_connection
        msg = "The server did not respond to the 'git-ls-remote' command."
        msg << ' Are the URL and Branch fields correct?'
        @errors << [:failed, msg] unless status.exist?
      end

      def public_url_regex
        %r{^(http|https|git)://(\w+@)?[\w\-\.]+(:\d+)?/[\w\-\./\~\+]*$}
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ohloh_scm-3.0.11 lib/ohloh_scm/git/validation.rb
ohloh_scm-3.0.10 lib/ohloh_scm/git/validation.rb