Sha256: 8bc9792419eab1bdba62105f8b75726769d2f00322dd22911fceaaf551ced9ba
Contents?: true
Size: 585 Bytes
Versions: 30
Compression:
Stored size: 585 Bytes
Contents
class Terraspace::Cloud::Api module Validate def validate(name, value) unless value =~ /^[\w-]*$/ message = "ERROR: #{name}: only allows letters, numbers, dashes, and underscores" end if value =~ /^[-_]/ || value =~ /[-_]$/ message = "ERROR: #{name}: no leading or trailing underscore or dash allowed" end if message puts message.color(:red) puts <<~EOL Please fix the configuration config/app.rb config.cloud.#{name} = '...' EOL exit 1 end end end end
Version data entries
30 entries across 30 versions & 1 rubygems