wwtd 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/lib/wwtd.rb CHANGED
@@ -4,6 +4,7 @@ require "yaml"
4
4
  require "shellwords"
5
5
  require "parallel"
6
6
  require "tempfile"
7
+ require "tmpdir"
7
8
 
8
9
  module WWTD
9
10
  CONFIG = ".travis.yml"
@@ -24,18 +25,20 @@ module WWTD
24
25
  # Execute tests
25
26
  matrix = matrix(config)
26
27
  results = nil
27
- Tempfile.open "wwtd" do |lock|
28
- results = Parallel.map(matrix.each_with_index, :in_processes => options[:parallel].to_i) do |config, i|
29
- ENV["TEST_ENV_NUMBER"] = (i == 0 ? "" : (i + 1).to_s) if options[:parallel]
28
+ with_clean_dot_bundle do
29
+ Tempfile.open "wwtd" do |lock|
30
+ results = Parallel.map(matrix.each_with_index, :in_processes => options[:parallel].to_i) do |config, i|
31
+ ENV["TEST_ENV_NUMBER"] = (i == 0 ? "" : (i + 1).to_s) if options[:parallel]
30
32
 
31
- config_info = config_info(matrix, config)
32
- puts "#{yellow("START")} #{config_info}"
33
+ config_info = config_info(matrix, config)
34
+ puts "#{yellow("START")} #{config_info}"
33
35
 
34
- result = run_config(config, lock)
35
- info = "#{result ? green("SUCCESS") : red("FAILURE")} #{config_info}"
36
- puts info
36
+ result = run_config(config, lock)
37
+ info = "#{result ? green("SUCCESS") : red("FAILURE")} #{config_info}"
38
+ puts info
37
39
 
38
- [result, info]
40
+ [result, info]
41
+ end
39
42
  end
40
43
  end
41
44
 
@@ -50,6 +53,19 @@ module WWTD
50
53
 
51
54
  private
52
55
 
56
+ def with_clean_dot_bundle
57
+ had_old = File.exist?(".bundle")
58
+ Dir.mktmpdir do |dir|
59
+ begin
60
+ sh "mv .bundle #{dir}" if had_old
61
+ yield
62
+ ensure
63
+ sh "rm -rf .bundle"
64
+ sh "mv #{dir}/.bundle ." if had_old
65
+ end
66
+ end
67
+ end
68
+
53
69
  def config_info(matrix, config)
54
70
  config = config.select { |k,v| matrix.map { |c| c[k] }.uniq.size > 1 }.sort
55
71
  "#{config.map { |k,v| "#{k}: #{truncate(v, 30)}" }.join(", ")}"
data/lib/wwtd/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module WWTD
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wwtd
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser
metadata.gz.sig CHANGED
Binary file