Module: ShowMeTheCookies
- Defined in:
- lib/show_me_the_cookies/version.rb,
lib/show_me_the_cookies.rb,
lib/show_me_the_cookies/adapters/webkit.rb,
lib/show_me_the_cookies/adapters/selenium.rb,
lib/show_me_the_cookies/adapters/rack_test.rb,
lib/show_me_the_cookies/adapters/poltergeist.rb,
lib/show_me_the_cookies/adapters/selenium_chrome.rb
Overview
change gem version here then use bundler’s rake tasks to make a new release follow semantic versioning guides.rubygems.org/patterns/#semantic-versioning
Defined Under Namespace
Classes: Poltergeist, RackTest, Selenium, SeleniumChrome, SeleniumSiteNotVisitedError, UnknownDriverError, Webkit
Constant Summary collapse
- VERSION =
'4.0.0'
Class Attribute Summary collapse
-
.adapters ⇒ Object
readonly
Returns the value of attribute adapters.
Class Method Summary collapse
-
.register_adapter(driver, adapter) ⇒ Object
Register your own capybara-driver cookie adapter.
Instance Method Summary collapse
-
#create_cookie(name, value, options = {}) ⇒ Object
can take the following options: :path :domain.
-
#delete_cookie(cookie_name) ⇒ Object
deletes the named cookie.
-
#expire_cookies ⇒ Object
removes session cookies and expired persistent cookies.
-
#get_me_the_cookie(cookie_name) ⇒ Object
returns a hash of the cookie form: :domain, :value, :expires, :path.
-
#get_me_the_cookies ⇒ Object
returns an array of cookie hashes form: [:domain, :value, :expires, :path].
-
#show_me_the_cookie(cookie_name) ⇒ Object
puts a string summary of the cookie.
-
#show_me_the_cookies ⇒ Object
puts a string summary of all cookies.
Class Attribute Details
.adapters ⇒ Object (readonly)
Returns the value of attribute adapters.
10 11 12 |
# File 'lib/show_me_the_cookies.rb', line 10 def adapters @adapters end |
Class Method Details
.register_adapter(driver, adapter) ⇒ Object
Register your own capybara-driver cookie adapter. Use the same name as the one Capybara does to identify that driver. Implement the interface of spec/shared_examples_for_api, as seen in lib/show_me_the_cookies/drivers
15 16 17 |
# File 'lib/show_me_the_cookies.rb', line 15 def register_adapter(driver, adapter) adapters[driver] = adapter end |
Instance Method Details
#create_cookie(name, value, options = {}) ⇒ Object
can take the following options: :path :domain
63 64 65 |
# File 'lib/show_me_the_cookies.rb', line 63 def (name, value, = {}) current_driver_adapter.(name, value, ) end |
#delete_cookie(cookie_name) ⇒ Object
deletes the named cookie
51 52 53 |
# File 'lib/show_me_the_cookies.rb', line 51 def () current_driver_adapter.() end |
#expire_cookies ⇒ Object
removes session cookies and expired persistent cookies
56 57 58 |
# File 'lib/show_me_the_cookies.rb', line 56 def current_driver_adapter. end |
#get_me_the_cookie(cookie_name) ⇒ Object
returns a hash of the cookie form: :domain, :value, :expires, :path
35 36 37 |
# File 'lib/show_me_the_cookies.rb', line 35 def () current_driver_adapter.() end |
#get_me_the_cookies ⇒ Object
returns an array of cookie hashes form: [:domain, :value, :expires, :path]
46 47 48 |
# File 'lib/show_me_the_cookies.rb', line 46 def current_driver_adapter. end |
#show_me_the_cookie(cookie_name) ⇒ Object
puts a string summary of the cookie
29 30 31 |
# File 'lib/show_me_the_cookies.rb', line 29 def () puts "#{}: #{().inspect}" end |
#show_me_the_cookies ⇒ Object
puts a string summary of all cookies
40 41 42 |
# File 'lib/show_me_the_cookies.rb', line 40 def puts "Cookies: #{.inspect}" end |