From b491af7647e1cfe59d4ae86ed52694f806eb8709 Mon Sep 17 00:00:00 2001 From: Vibhaj Rajan Date: Wed, 2 Mar 2016 19:35:13 +0530 Subject: [PATCH 1/3] added 1.8.7 support --- .travis.yml | 3 ++- lib/browserstack/local.rb | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4023e9f..5f0cb70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,8 @@ language: ruby rvm: - - 1.9.3 - 2.2.1 + - 1.9.3 + - 1.8.7 before_install: - true && `base64 --decode <<< ZXhwb3J0IEJST1dTRVJTVEFDS19BQ0NFU1NfS0VZPUh5VmZydXJvb3dYb041eGhLZEs2Cg==` diff --git a/lib/browserstack/local.rb b/lib/browserstack/local.rb index 02d71db..db8814e 100644 --- a/lib/browserstack/local.rb +++ b/lib/browserstack/local.rb @@ -9,6 +9,7 @@ class Local def initialize(key = ENV["BROWSERSTACK_ACCESS_KEY"]) @key = key @logfile = File.join(Dir.pwd, "local.log") + @exec = RbConfig::CONFIG['host_os'].match(/mswin|msys|mingw|cygwin|bccwin|wince|emc/) ? "call" : "exec"; end def add_args(key, value=nil) @@ -58,9 +59,11 @@ def start(options = {}) end system("echo '' > '#{@logfile}'") - #@pid = spawn() - #Process.detach @pid - @process = IO.popen(command_args) + if defined? spawn + @process = IO.popen(command_args) + else + @process = IO.popen(command) + end @stdout = File.open(@logfile, "r") while true @@ -103,7 +106,7 @@ def stop end def command - "#{@binary_path} -logFile '#{@logfile}' #{@folder_flag} #{@key} #{@folder_path} #{@force_local_flag} #{@local_identifier_flag} #{@only_flag} #{@only_automate_flag} #{@proxy_host} #{@proxy_port} #{@proxy_user} #{@proxy_pass} #{@force_flag} #{@verbose_flag} #{@hosts}".strip + "#{@exec} #{@binary_path} -logFile '#{@logfile}' #{@folder_flag} #{@key} #{@folder_path} #{@force_local_flag} #{@local_identifier_flag} #{@only_flag} #{@only_automate_flag} #{@proxy_host} #{@proxy_port} #{@proxy_user} #{@proxy_pass} #{@force_flag} #{@verbose_flag} #{@hosts}".strip end def command_args From 0de8a9c5dda11e7ec44181e51fdaa5139b6b40c4 Mon Sep 17 00:00:00 2001 From: Vibhaj Rajan Date: Wed, 2 Mar 2016 23:28:09 +0530 Subject: [PATCH 2/3] added osx --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5f0cb70..2756e0e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,9 @@ language: ruby + +os: + - linux + - osx + rvm: - 2.2.1 - 1.9.3 From ce53eebceed1d6e1d7bfb78ea14eb578677dc23f Mon Sep 17 00:00:00 2001 From: Vibhaj Rajan Date: Thu, 3 Mar 2016 00:39:51 +0530 Subject: [PATCH 3/3] added matrix --- .travis.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2756e0e..8192cf1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,21 @@ language: ruby -os: - - linux - - osx - -rvm: - - 2.2.1 - - 1.9.3 - - 1.8.7 +matrix: + include: + - os: linux + ruby: 2.2.2 + - os: linux + ruby: 2.2.1 + - os: linux + ruby: 1.9.3 + - os: linux + ruby: 1.8.7 + - os: osx + ruby: 2.2.2 + - os: osx + ruby: 2.2.1 + - os: osx + ruby: 1.9.3 before_install: - true && `base64 --decode <<< ZXhwb3J0IEJST1dTRVJTVEFDS19BQ0NFU1NfS0VZPUh5VmZydXJvb3dYb041eGhLZEs2Cg==`