class MakersToolbelt::CommandLine::GetURI
Private Instance Methods
valid_uri?(input)
click to toggle source
# File lib/makers_toolbelt/command_line/questions/get_uri.rb, line 16 def valid_uri?(input) input =~ /\A#{URI::regexp(['http', 'https'])}\z/ end
validate(input)
click to toggle source
# File lib/makers_toolbelt/command_line/questions/get_uri.rb, line 10 def validate(input) return input if input.empty? raise "You must enter a valid uri e.g. https://example.com" unless valid_uri?(input) input end