Class: Ronin::App::Validations::InstallRepoParams
- Inherits:
-
Dry::Validation::Contract
- Object
- Dry::Validation::Contract
- Ronin::App::Validations::InstallRepoParams
- Defined in:
- lib/ronin/app/validations/install_repo_params.rb
Overview
Validations for form params submitted to POST /repos/install
.
Constant Summary collapse
- URI_REGEX =
Regular expression that matches
https://
,http://
,ssh://
, andgit://
URIs. URI::DEFAULT_PARSER.make_regexp(%w[https http git ssh])
- GIT_URI_REGEX =
Regular expression that matches both
https://
URIs andgit@host.com:path/to/repo.git
URIs. %r{\A(?:#{URI_REGEX}|[^@]+@[A-Za-z0-9._-]+(?::\d+)?:[A-Za-z0-9./_-]+)\z}
- NAME_REGEX =
Regular expression that matches an alpha-numeric name containing dashes and/or underscores.
/\A[A-Za-z0-9_-]+\z/
Class Method Summary collapse
-
.call(params) ⇒ Dry::Validation::Result
Initializes and calls the validation contract.
Class Method Details
.call(params) ⇒ Dry::Validation::Result
Initializes and calls the validation contract.
71 72 73 |
# File 'lib/ronin/app/validations/install_repo_params.rb', line 71 def self.call(params) new.call(params) end |