Class: Moogle::BlogTarget

Inherits:
Target
  • Object
show all
Defined in:
lib/moogle/models/blog_target.rb

Instance Method Summary collapse

Methods inherited from Target

default_repository_name

Instance Method Details

#validate_optionsObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/moogle/models/blog_target.rb', line 11

def validate_options
  uri = Addressable::URI.parse options['rpc_uri']
  return false, 'options rpc_uri not set' if uri.nil?
  return false, 'options rpc_uri must be absolute URI' if uri.relative?

  uri = Addressable::URI.parse options['blog_uri']
  return false, 'options blog_uri not set' if uri.nil?
  return false, 'options blog_uri must be absolute URI' if uri.relative?

  return false, 'options blog_id is blank' if options['blog_id'].blank?
  return false, 'options username is blank' if options['username'].blank?
  return false, 'options password is blank' if options['password'].blank?
  return false, 'options publish_immediately is blank' if(
    options['publish_immediately'].blank?)
  return true
end