rainforest_ruby_runtime 0.1.0 → 0.1.1

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: 1504bf22a8dea19e857d7b408594412e1151a9ab
4
- data.tar.gz: cfabcb8af8b10d8588fa570e61c1f725ae8b64aa
3
+ metadata.gz: 8d7eecd75c136b9028aee539b2713e2cef9c16e8
4
+ data.tar.gz: 748276ffcdcb75c97494954754500f1c81af2c7e
5
5
  SHA512:
6
- metadata.gz: 645ff7563f78bbd339f732588e2507af95c2b14389d0ab88a143491aaf652e6200770ea92163526d4b7cac92ecb7f4169fa170e0f308ec77c9bb03dad4c588b2
7
- data.tar.gz: f5ef4ce3ad10defe54167650b16b95616ee355a929d45b3dc5317215923da9b58943647b9e34a17609134886a25b0bb47cc12127408415e79a4c7fe5b7d13563
6
+ metadata.gz: b280d275703dcc7d0873b78ca3b116128946f6ef5cdf6ee9ddc4424b11802d917886dcd940ef39df21f5d18d04daa9db5ed73308c7ffefed1427e5dccff50abe
7
+ data.tar.gz: 6c2f762f6ea07fc770d374ea454d5c8a403740bced949131f49c43691c3bb879545ef2fb0195529495654d00cd50ff9e351297079664e4df8669305be6b9f691
data/.gitignore CHANGED
@@ -22,3 +22,4 @@ tmp
22
22
  mkmf.log
23
23
  tags
24
24
  vendor/sauce/sc
25
+ vendor/sauce/sc.exe
@@ -1,4 +1,10 @@
1
- # 0.1.0 - 2018-04-13
1
+ # 0.1.1 - 2018-04-13
2
+
3
+ - Monkey patch `Process::RLIMIT_NOFILE` and `Process.getrlimit` on Windows
4
+ - Fixed SauceConnect executable path on Windows
5
+ - Don't start local server when running from a Rails repo
6
+
7
+ # 0.1.0 - 2018-04-12
2
8
 
3
9
  - Support multiple browsers with `--browsers` param
4
10
  - Change default browser to `chrome` (used to be `firefox`)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Rainforest Ruby Runtime
2
2
 
3
- [![CircleCI](https://circleci.com/gh/rainforestapp/rainforest_ruby_runtime/tree/master.svg?style=svg)](https://circleci.com/gh/rainforestapp/rainforest_ruby_runtime/tree/master)
3
+ [![CircleCI](https://circleci.com/gh/rainforestapp/rainforest_ruby_runtime/tree/master.svg?style=svg&circle-token=8e3a287695cc26b190e8dc5a4f0c59fb747a79a6)](https://circleci.com/gh/rainforestapp/rainforest_ruby_runtime/tree/master)
4
4
 
5
5
  Gem to run Rainforest Automated Tests locally or on Sauce Labs.
6
6
 
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rainforest_ruby_runtime'
2
3
  require 'rspec/core/rake_task'
3
4
  require 'fileutils'
4
5
  require 'open-uri'
@@ -12,16 +13,17 @@ end
12
13
 
13
14
  task :prepare_sauce do
14
15
  sc =
15
- case RUBY_PLATFORM
16
- when /cygwin|mswin|mingw|bccwin|wince|emx/ then 'sc-windows.exe'
17
- when /darwin/ then 'sc-osx'
16
+ case RainforestRubyRuntime.platform
17
+ when :windows then 'sc-windows.exe'
18
+ when :osx then 'sc-osx'
18
19
  else 'sc-linux'
19
20
  end
20
21
 
22
+
21
23
  FileUtils.mkdir_p('vendor/sauce')
22
24
  url = "#{GITHUB_REPO}/v#{RainforestRubyRuntime::VERSION}/vendor/sauce/#{sc}"
23
25
 
24
- File.open('vendor/sauce/sc', 'wb') do |file|
26
+ File.open(RainforestRubyRuntime.sc_executable_path, 'wb') do |file|
25
27
  IO.copy_stream(open(url), file)
26
28
  file.chmod(0755)
27
29
  end
@@ -1,3 +1,5 @@
1
+ require "rainforest_ruby_runtime/process_monkey_patch"
2
+
1
3
  require "sauce"
2
4
  require "sauce/capybara"
3
5
  require "rspec/expectations"
@@ -17,7 +19,23 @@ require "rainforest_ruby_runtime/variables/registry"
17
19
  require "rainforest_ruby_runtime/variables/scope"
18
20
 
19
21
  module RainforestRubyRuntime
22
+ def self.platform
23
+ case RUBY_PLATFORM
24
+ when /cygwin|mswin|mingw|bccwin|wince|emx/ then :windows
25
+ when /darwin/ then :osx
26
+ else :linux
27
+ end
28
+ end
29
+
20
30
  def self.root
21
31
  File.dirname(__dir__)
22
32
  end
33
+
34
+ def self.sc_executable_path
35
+ if platform == :windows
36
+ 'vendor/sauce/sc.exe'
37
+ else
38
+ 'vendor/sauce/sc'
39
+ end
40
+ end
23
41
  end
@@ -24,7 +24,9 @@ module RainforestRubyRuntime
24
24
  def apply_config
25
25
  ::Sauce.config do |c|
26
26
  c[:browsers] = browsers
27
- c[:sauce_connect_4_executable] = File.join(RainforestRubyRuntime.root, '/vendor/sauce/sc')
27
+ c[:sauce_connect_4_executable] = File.join(
28
+ RainforestRubyRuntime.root,
29
+ RainforestRubyRuntime.sc_executable_path)
28
30
  c[:start_local_application] = false
29
31
  end
30
32
  end
@@ -0,0 +1,13 @@
1
+ module Process
2
+ if Gem.win_platform?
3
+ # On Windows:
4
+ # - RLIMIT_NOFILE is not defined
5
+ # - .getrlimit is unimplemented
6
+
7
+ RLIMIT_NOFILE = 8
8
+
9
+ def self.getrlimit(_resource)
10
+ [256, 1024]
11
+ end
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module RainforestRubyRuntime
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rainforest_ruby_runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Mathieu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-12 00:00:00.000000000 Z
12
+ date: 2018-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pry
@@ -219,6 +219,7 @@ files:
219
219
  - lib/rainforest_ruby_runtime/empty.rb
220
220
  - lib/rainforest_ruby_runtime/exceptions.rb
221
221
  - lib/rainforest_ruby_runtime/nil_delegator.rb
222
+ - lib/rainforest_ruby_runtime/process_monkey_patch.rb
222
223
  - lib/rainforest_ruby_runtime/runner.rb
223
224
  - lib/rainforest_ruby_runtime/test.rb
224
225
  - lib/rainforest_ruby_runtime/variables/registry.rb