Module: DockTest::DSL

Included in:
DockTest
Defined in:
lib/dock_test/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#oauth_consumer_keyObject

oauth settings



28
29
30
# File 'lib/dock_test/dsl.rb', line 28

def oauth_consumer_key
  @oauth_consumer_key
end

#oauth_consumer_secretObject

oauth settings



28
29
30
# File 'lib/dock_test/dsl.rb', line 28

def oauth_consumer_secret
  @oauth_consumer_secret
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/dock_test/dsl.rb', line 4

def url
  @url
end

Instance Method Details

#configure(&block) ⇒ Object



68
69
70
# File 'lib/dock_test/dsl.rb', line 68

def configure(&block)
  block.call(DockTest)
end

#localhost?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/dock_test/dsl.rb', line 44

def localhost?
  @url && ['127.0.0.1', 'localhost'].include?(URI.parse(@url).host)
end

#mount_pathObject



35
36
37
38
# File 'lib/dock_test/dsl.rb', line 35

def mount_path
  p = URI.parse(@url).path
  p.empty? ? '/' : p
end

#oauth?Boolean

if the current dock_test environment requires oauth

Returns:

  • (Boolean)


31
32
33
# File 'lib/dock_test/dsl.rb', line 31

def oauth?
  oauth_consumer_key && oauth_consumer_secret
end

#portObject



40
41
42
# File 'lib/dock_test/dsl.rb', line 40

def port
  URI.parse(@url).port
end

#skippy=(skippy) ⇒ Object



48
49
50
# File 'lib/dock_test/dsl.rb', line 48

def skippy=(skippy)
  @skippy = skippy
end

#skippy?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/dock_test/dsl.rb', line 52

def skippy?
  @skippy || false
end

#verify_modeObject



60
61
62
63
64
65
66
# File 'lib/dock_test/dsl.rb', line 60

def verify_mode
  if @verify_ssl.nil? || @verify_ssl
    OpenSSL::SSL::VERIFY_PEER
  else
    OpenSSL::SSL::VERIFY_NONE
  end
end

#verify_ssl=(verify_ssl) ⇒ Object



56
57
58
# File 'lib/dock_test/dsl.rb', line 56

def verify_ssl=(verify_ssl)
  @verify_ssl = verify_ssl
end