crossbrowsify 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 425ab398a5b606fc4680395ef6024fce567b1dad
4
- data.tar.gz: 57b48835a550b70f2c88415ed73b2dab0430e91b
3
+ metadata.gz: 2dc112252fd8e74c40e7f0e7f83cbb4ea5b244b2
4
+ data.tar.gz: c91e68eb1a88b80dfe8063984afad3e88f6c25bf
5
5
  SHA512:
6
- metadata.gz: 7300363a8ba25a6adf4b918bece9a92599d4a6d479f5b2790a3e58874d5b3e9108d385c7336b684780db695831806b00e8d8c7aee12fb472a922ccd91938d688
7
- data.tar.gz: 490667dffadaefa5de75fffe7d7a57fdfef3b9df64896c109b5a7b2fe6632bf057644462c9f76da04133af5bcb324209c6dd5611fedd0af4c20683a8c14424a2
6
+ metadata.gz: b455d1521841011b22722cd8ca8064aafd16f535e568a27542e6b1d6c6815e6fd8ac415270059c7c85057a40c36e037253e5f92e4ed718adec506b78e5b5abd5
7
+ data.tar.gz: b4c41e18323c8ce416f16954ac07b85b41ea9e3a567d8744f59424e4685ff6aa9b428424f3e0244f48ffd3f225ec2edba0cc2f4c1900b89f10073c288d7ab8cc
@@ -1,3 +1,3 @@
1
1
  module Crossbrowsify
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'cucumber/rake/task'
2
2
 
3
3
 
4
- BROWSERS = JSON.load(open('browsers.json'))
4
+ BROWSERS = JSON.load(File.open('browsers.json'))
5
5
 
6
6
  desc 'Run all cross browser tests in parallel (with ENV["nodes"] parallel limit)'
7
7
  task :crossbrowsify => [:environment] do
@@ -22,7 +22,36 @@ task :crossbrowsify => [:environment] do
22
22
  end
23
23
  end
24
24
 
25
+
26
+
27
+
25
28
  namespace :crossbrowsify do
29
+
30
+ desc "Downloading browserstack binary"
31
+ task :setup do
32
+ download_browserstack unless File.exists? 'BrowserStackLocal'
33
+ end
34
+
35
+ desc "Open a tunnel for browserstack to access"
36
+ task :run_local => [:setup] do
37
+ unless File.exists? 'browserstack_tunnel_map.json'
38
+ raise 'Missing browserstack_tunnel_map.json file! [{ name: "hostname", port: port_number}, ...]'
39
+ end
40
+
41
+ hosts = JSON.load(File.open('browserstack_tunnel_map.json')).inject('') do |params, host|
42
+ params += host['name'] + ',' + host['port'].to_s + ',0,'
43
+ end
44
+
45
+ identifier = ENV['CI'] ? "#{ENV['CIRCLE_PROJECT_REPONAME']}-node-#{ENV['CIRCLE_NODE_INDEX']}" : 'localhost'
46
+
47
+ puts 'Starting a local tunnel to Browserstack...'
48
+ tunnel = Thread.new do
49
+ puts `./BrowserStackLocal -localIdentifier #{identifier} -force -skipCheck $BS_AUTHKEY #{hosts}`
50
+ end
51
+ puts 'Started!'
52
+ tunnel.join
53
+ end
54
+
26
55
  BROWSERS.each_pair do |browser_name, browser|
27
56
  mobile = browser["mobile"] || false
28
57
 
@@ -44,3 +73,14 @@ namespace :crossbrowsify do
44
73
  end
45
74
  end
46
75
  end
76
+
77
+ def download_browserstack
78
+ if `uname` =~ /darwin/i
79
+ url = "https://www.browserstack.com/browserstack-local/BrowserStackLocal-darwin-x64.zip"
80
+ else
81
+ url = "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip "
82
+ end
83
+ `curl #{url} > browserstack.zip`
84
+ `unzip browserstack.zip`
85
+ File.delete('browserstack.zip')
86
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crossbrowsify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Haiku Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-04 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler