Sha256: 05a4cbdd9c83e543ea83f709d96639c788fa03b7a2eebcccf018a89b2b3cd59a

Contents?: true

Size: 649 Bytes

Versions: 37

Compression:

Stored size: 649 Bytes

Contents

module OhlohScm::Adapters
	class HgAdapter < AbstractAdapter
		def self.url_regex
			/^((http|https|ssh|file):\/\/((\w+@)?[A-Za-z0-9_\-\.]+(:\d+)?\/)?)?[A-Za-z0-9_@\-\.\/\~\+]*$/
		end

		def self.public_url_regex
			/^(http|https):\/\/(\w+@)?[A-Za-z0-9_\-\.]+(:\d+)?\/[A-Za-z0-9_\-\.\/\~\+]*$/
		end

		def validate_server_connection
			return unless valid?
			@errors << [:failed, "The server did not respond to the 'hg id' command. Is the URL correct?"] unless self.exist?
		end

		def guess_forge
			u = @url =~ /:\/\/(.*\.?hg\.)?([^\/^:]+)(:\d+)?\// ? $2 : nil
			case u
			when /(sourceforge\.net$)/
				$1
			else
				u
			end
		end
	end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
ohloh_scm-2.5.1 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.14 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.13 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.12 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.11 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.10 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.9 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.8 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.7 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.6 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.5 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.4 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.3 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.1 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.4.0 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.3.5 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.3.4 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.3.2 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.3.1 lib/ohloh_scm/adapters/hg/validation.rb
ohloh_scm-2.3.0 lib/ohloh_scm/adapters/hg/validation.rb