File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+ require_relative "url"
2+
13module BrowserStackButton
24 module Helpers
35 def browser_stack_button
@@ -6,7 +8,8 @@ def browser_stack_button
68
79 def each_browser_stack_browser_and_url
810 BrowserStackButton . configuration . browsers . each do |name , options |
9- yield name , "world"
11+ options = BrowserStackButton . configuration . default_options . merge options
12+ yield name , BrowserStackButton ::Url . new ( "http://google.com" , options ) . to_s
1013 end
1114 end
1215 end
Original file line number Diff line number Diff line change 1+ require "cgi"
2+
3+ module BrowserStackButton
4+ class Url
5+ def initialize ( url , options = { } )
6+ params = options . map { |k , v | "#{ CGI . escape ( k . to_s ) } =#{ CGI . escape ( v . to_s ) } " } . join ( "&" )
7+
8+ @url = "http://www.browserstack.com/start##{ params } "
9+ end
10+
11+ def to_s
12+ @url
13+ end
14+ end
15+ end
You can’t perform that action at this time.
0 commit comments