Module: DockTest::DSL
- Included in:
- DockTest
- Defined in:
- lib/dock_test/dsl.rb
Instance Attribute Summary collapse
-
#oauth_consumer_key ⇒ Object
oauth settings.
-
#oauth_consumer_secret ⇒ Object
oauth settings.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #configure(&block) ⇒ Object
- #localhost? ⇒ Boolean
- #mount_path ⇒ Object
-
#oauth? ⇒ Boolean
if the current dock_test environment requires oauth.
- #port ⇒ Object
- #skippy=(skippy) ⇒ Object
- #skippy? ⇒ Boolean
- #verify_mode ⇒ Object
- #verify_ssl=(verify_ssl) ⇒ Object
Instance Attribute Details
#oauth_consumer_key ⇒ Object
oauth settings
28 29 30 |
# File 'lib/dock_test/dsl.rb', line 28 def oauth_consumer_key @oauth_consumer_key end |
#oauth_consumer_secret ⇒ Object
oauth settings
28 29 30 |
# File 'lib/dock_test/dsl.rb', line 28 def oauth_consumer_secret @oauth_consumer_secret end |
#url ⇒ Object
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
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_path ⇒ Object
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
31 32 33 |
# File 'lib/dock_test/dsl.rb', line 31 def oauth? oauth_consumer_key && oauth_consumer_secret end |
#port ⇒ Object
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
52 53 54 |
# File 'lib/dock_test/dsl.rb', line 52 def skippy? @skippy || false end |
#verify_mode ⇒ Object
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 |