Class: LetsencryptWebfaction::DomainValidator::Validation
- Inherits:
-
Object
- Object
- LetsencryptWebfaction::DomainValidator::Validation
- Defined in:
- lib/letsencrypt_webfaction/domain_validator.rb
Instance Method Summary collapse
-
#initialize(domain, challenge) ⇒ Validation
constructor
A new instance of Validation.
-
#print_error ⇒ Object
rubocop:disable Metrics/MethodLength.
- #url ⇒ Object
Constructor Details
#initialize(domain, challenge) ⇒ Validation
Returns a new instance of Validation.
68 69 70 71 |
# File 'lib/letsencrypt_webfaction/domain_validator.rb', line 68 def initialize(domain, challenge) @domain = domain @challenge = challenge end |
Instance Method Details
#print_error ⇒ Object
rubocop:disable Metrics/MethodLength
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/letsencrypt_webfaction/domain_validator.rb', line 73 def print_error # rubocop:disable Metrics/MethodLength case @challenge..verify_status when 'valid' $stderr.puts "#{@domain}: Success" when 'invalid' $stderr.puts "#{@domain}: #{@challenge.error['detail']}" $stderr.puts "Make sure that you can access #{url}" when 'pending' $stderr.puts "#{@domain}: Still pending, but timed out" else $stderr.puts "#{@domain}: Unexpected authorization status #{@challenge.authorization.verify_status}" end end |
#url ⇒ Object
87 88 89 |
# File 'lib/letsencrypt_webfaction/domain_validator.rb', line 87 def url "http://#{@domain}/#{@challenge.filename}" end |