rake-funnel 0.20.2 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f08e7fd2daf8b94adc2b74e4c6f46e1929e9160
4
- data.tar.gz: 2eb3341a6fee6a13b0852a52a15aa7dc39e1136c
3
+ metadata.gz: 6841ebbb9d8d034742f00ffb6249df517b003e65
4
+ data.tar.gz: e9c884b4db0309c9abbd2dea0500e39316d3c384
5
5
  SHA512:
6
- metadata.gz: 07e69ce186b9d9f51b67de17982caf74cf5246ec0ce181c8716922dcc602a2f57c8c7f39fb1c7505eeb27a17d0fdba44894e6401d7cf90443c319a760bc24122
7
- data.tar.gz: ca88f3464ddbef5a69d05ba60e6d30699f926a5eb923c9507d9b45ade243669d606ffc0b966f51b2640874f2eefb785efb305668be8adb9b203fdf187211053b
6
+ metadata.gz: 941d28a728ca71c7b4127b992b821fd4124557887bce2abe0962361a4d1f2c202cf3d0262570c3fd5660c4409e15599aa26d6f270bfa35b4f1e5579f8ad3bdc0
7
+ data.tar.gz: 477e620f47de4991a81291d82195c43898a4c35a562a242f73d0e06e65614c7b5fea3e0d7f8dc3072f4d78bd2584e17dc2911d583ce3d05a99ebdf2ca9a756fc
@@ -6,12 +6,19 @@ module Rake
6
6
  def invocation(executable, *args)
7
7
  exe_args = ([executable] << args).flatten.compact
8
8
 
9
- return exe_args if Rake::Win32.windows?
9
+ return exe_args if Rake::Win32.windows? || wsl?
10
10
 
11
11
  executable = exe_args.shift
12
12
  found = Which.which(executable) || executable
13
13
  exe_args.unshift('mono', found)
14
14
  end
15
+
16
+ private
17
+
18
+ def wsl?
19
+ File.readable?('/proc/version') && \
20
+ File.read('/proc/version').include?('Microsoft')
21
+ end
15
22
  end
16
23
  end
17
24
  end
@@ -27,7 +27,7 @@ module Rake
27
27
  @stats = Statistics.new
28
28
  end
29
29
 
30
- def define(_args, &task_block) # rubocop:disable Metrics/AbcSize
30
+ def define(_args, &task_block)
31
31
  patches.each(&:apply!)
32
32
 
33
33
  task name, :failed do |_, task_args|
@@ -1,5 +1,5 @@
1
1
  module Rake
2
2
  module Funnel
3
- VERSION = '0.20.2'.freeze
3
+ VERSION = '0.21.0'.freeze
4
4
  end
5
5
  end
@@ -3,13 +3,7 @@ require 'tmpdir'
3
3
  include Rake::Funnel::Support
4
4
 
5
5
  describe Rake::Funnel::Support::Mono do
6
- before do
7
- allow(Rake::Win32).to receive(:windows?).and_return(windows?)
8
- end
9
-
10
- context 'on Windows' do
11
- let(:windows?) { true }
12
-
6
+ shared_examples 'on Windows' do
13
7
  it 'should return executable' do
14
8
  expect(described_class.invocation('executable.exe')).to eq(%w(executable.exe))
15
9
  end
@@ -31,10 +25,34 @@ describe Rake::Funnel::Support::Mono do
31
25
  end
32
26
  end
33
27
 
28
+ before do
29
+ allow(Rake::Win32).to receive(:windows?).and_return(windows?)
30
+ end
31
+
32
+ context 'on Windows' do
33
+ context 'plain Windows' do
34
+ let(:windows?) { true }
35
+
36
+ it_behaves_like 'on Windows'
37
+ end
38
+
39
+ context 'Windows Subsystem for Linux' do
40
+ let(:windows?) { false }
41
+
42
+ before do
43
+ allow(File).to receive(:readable?).with('/proc/version').and_return(true)
44
+ allow(File).to receive(:read).with('/proc/version').and_return('Microsoft')
45
+ end
46
+
47
+ it_behaves_like 'on Windows'
48
+ end
49
+ end
50
+
34
51
  context 'not on Windows' do
35
52
  let(:windows?) { false }
36
53
 
37
54
  before do
55
+ allow(File).to receive(:readable?).with('/proc/version').and_return(false)
38
56
  allow(Which).to receive(:which)
39
57
  end
40
58
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-funnel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.2
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Groß
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-08 00:00:00.000000000 Z
11
+ date: 2017-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -233,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
233
  version: '0'
234
234
  requirements: []
235
235
  rubyforge_project:
236
- rubygems_version: 2.5.2
236
+ rubygems_version: 2.6.11
237
237
  signing_key:
238
238
  specification_version: 4
239
239
  summary: A build pipeline targeted at .NET projects. Supports environment configuration