rake-funnel 0.11.0.pre → 0.12.0.pre
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 +4 -4
- data/lib/rake/funnel/support/assembly_version_writer.rb +1 -1
- data/lib/rake/funnel/support/internal/instantiate_symbol.rb +11 -6
- data/lib/rake/funnel/support/mapper.rb +1 -1
- data/lib/rake/funnel/support/msbuild/build_tool.rb +1 -1
- data/lib/rake/funnel/version.rb +1 -1
- data/spec/rake/funnel/integration/teamcity/teamcity_spec.rb +1 -1
- data/spec/rake/funnel/support/assembly_version_writer_spec.rb +2 -2
- data/spec/rake/funnel/support/internal/instantiate_symbol_spec.rb +29 -0
- data/spec/rake/funnel/support/msbuild/build_tool_spec.rb +27 -2
- data/spec/rake/funnel/support/template_engine_spec.rb +1 -1
- data/spec/rake/funnel/tasks/paket_spec.rb +2 -2
- metadata +3 -6
- data/lib/rake/funnel/extensions/windows_path.rb +0 -15
- data/spec/rake/funnel/extensions/windows_path_spec.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56bac75630655218368ec2766ffb96bac889e2ae
|
4
|
+
data.tar.gz: e073088cbdf589d3b9b5324b5a5e94ca910bd7f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47c4be285e4c7b52db8250a4f2c4517d24cfd734affd44135966e4f7caeed992a223bc1316718fb86463701b9a0adad8beffd499f762bd2fb792bdf0721b2cf9
|
7
|
+
data.tar.gz: 01d64a7f8f98b43cc027f28424318621fd95a49499f547e600adc5bbc3738170a8a4317cb32e8873683620566103dce5e755e7941a4a0f681460596018bbcee5
|
@@ -20,17 +20,22 @@ module Rake
|
|
20
20
|
def create(sym, *args)
|
21
21
|
return sym unless sym.is_a?(Symbol)
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
found = [sym, sym.pascalize.to_sym]
|
24
|
+
.select { |candidate| mod.constants.include?(candidate) }
|
25
|
+
.first
|
26
|
+
|
27
|
+
raise NameError, "Unknown type to instantiate: #{sym.inspect}. Available types are: #{available.inspect}" if found.nil?
|
28
28
|
|
29
|
+
type = mod.const_get(found)
|
29
30
|
type.new(*args)
|
30
31
|
end
|
31
32
|
|
32
33
|
def available
|
33
|
-
|
34
|
+
mod.constants.sort
|
35
|
+
end
|
36
|
+
|
37
|
+
def mod
|
38
|
+
self.class.module
|
34
39
|
end
|
35
40
|
end
|
36
41
|
end
|
@@ -10,7 +10,7 @@ module Rake
|
|
10
10
|
include InstantiateSymbol
|
11
11
|
instantiate Styles
|
12
12
|
|
13
|
-
def initialize(style = :
|
13
|
+
def initialize(style = :default)
|
14
14
|
raise "You cannot use the 'nil' mapper style. Available mappers are: #{available.inspect}" if style.nil?
|
15
15
|
|
16
16
|
@style = create(style)
|
data/lib/rake/funnel/version.rb
CHANGED
@@ -91,7 +91,7 @@ describe Rake::Funnel::Integration::TeamCity do
|
|
91
91
|
|
92
92
|
context 'block error' do
|
93
93
|
it 'should reset path' do
|
94
|
-
expect { described_class.with_java_runtime { fail 'with some error' } }.to raise_error
|
94
|
+
expect { described_class.with_java_runtime { fail 'with some error' } }.to raise_error(/with some error/)
|
95
95
|
|
96
96
|
expect(ENV).to have_received(:[]=).with('PATH', original_path)
|
97
97
|
end
|
@@ -10,12 +10,12 @@ describe Rake::Funnel::Support::AssemblyVersionWriter do
|
|
10
10
|
}
|
11
11
|
|
12
12
|
it 'should create FromVersionFiles with empty args' do
|
13
|
-
expect(subject).to have_received(:create).with(:
|
13
|
+
expect(subject).to have_received(:create).with(:from_version_files, {})
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
describe 'custom type' do
|
18
|
-
let(:source) { :
|
18
|
+
let(:source) { :custom }
|
19
19
|
let(:source_args) { { foo: 42 } }
|
20
20
|
|
21
21
|
before {
|
@@ -25,6 +25,20 @@ describe Rake::Funnel::Support::InstantiateSymbol do
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
module SnakeCase
|
29
|
+
class SnakeCase
|
30
|
+
end
|
31
|
+
|
32
|
+
class Snake_Case
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class SnakeCaseModuleDefinition
|
37
|
+
include Rake::Funnel::Support::InstantiateSymbol
|
38
|
+
|
39
|
+
instantiate SnakeCase
|
40
|
+
end
|
41
|
+
|
28
42
|
describe 'module methods' do
|
29
43
|
subject {
|
30
44
|
ExplicitModuleDefinition.new
|
@@ -34,6 +48,7 @@ describe Rake::Funnel::Support::InstantiateSymbol do
|
|
34
48
|
it 'should not be public' do
|
35
49
|
expect(subject).not_to respond_to(:create)
|
36
50
|
expect(subject).not_to respond_to(:available)
|
51
|
+
expect(subject).not_to respond_to(:mod)
|
37
52
|
end
|
38
53
|
end
|
39
54
|
|
@@ -107,6 +122,20 @@ describe Rake::Funnel::Support::InstantiateSymbol do
|
|
107
122
|
end
|
108
123
|
end
|
109
124
|
|
125
|
+
context 'snake cased symbol' do
|
126
|
+
subject {
|
127
|
+
SnakeCaseModuleDefinition.new
|
128
|
+
}
|
129
|
+
|
130
|
+
it 'should return instance' do
|
131
|
+
expect(subject.send(:create, :snake_case)).to be_an_instance_of(SnakeCase::SnakeCase)
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'should prefer explicit type' do
|
135
|
+
expect(subject.send(:create, :Snake_Case)).to be_an_instance_of(SnakeCase::Snake_Case)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
110
139
|
context 'instantiation fails' do
|
111
140
|
class WillFail
|
112
141
|
include Rake::Funnel::Support::InstantiateSymbol
|
@@ -6,8 +6,33 @@ describe Rake::Funnel::Support::MSBuild::BuildTool do
|
|
6
6
|
context 'on Windows', platform: :win32 do
|
7
7
|
let(:windows?) { true }
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
before {
|
10
|
+
allow(::Win32::Registry::HKEY_LOCAL_MACHINE).to receive(:open).and_yield({ 'MSBuildToolsPath' => 'path'})
|
11
|
+
}
|
12
|
+
|
13
|
+
it 'should search the registry for known MSBuild versions' do
|
14
|
+
described_class.find
|
15
|
+
expect(::Win32::Registry::HKEY_LOCAL_MACHINE).to have_received(:open).at_least(:once)
|
16
|
+
end
|
17
|
+
|
18
|
+
context 'MSBuild exists' do
|
19
|
+
before {
|
20
|
+
allow(File).to receive(:exist?).with('path/msbuild.exe').and_return(true)
|
21
|
+
}
|
22
|
+
|
23
|
+
it 'should find msbuild.exe' do
|
24
|
+
expect(described_class.find).to eq('path/msbuild.exe')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context 'MSBuild does not exist' do
|
29
|
+
before {
|
30
|
+
allow(File).to receive(:exist?).with('path/msbuild.exe').and_return(false)
|
31
|
+
}
|
32
|
+
|
33
|
+
it 'should not find msbuild.exe' do
|
34
|
+
expect(described_class.find).to be_nil
|
35
|
+
end
|
11
36
|
end
|
12
37
|
end
|
13
38
|
|
@@ -110,7 +110,7 @@ describe Rake::Funnel::Tasks::Paket do
|
|
110
110
|
}
|
111
111
|
|
112
112
|
it 'should fail' do
|
113
|
-
expect { Task[subject.name].invoke }.to raise_error
|
113
|
+
expect { Task[subject.name].invoke }.to raise_error(RuntimeError)
|
114
114
|
end
|
115
115
|
end
|
116
116
|
end
|
@@ -130,7 +130,7 @@ describe Rake::Funnel::Tasks::Paket do
|
|
130
130
|
end
|
131
131
|
|
132
132
|
it 'should fail' do
|
133
|
-
expect { Task[subject.name].invoke }.to raise_error
|
133
|
+
expect { Task[subject.name].invoke }.to raise_error(RuntimeError)
|
134
134
|
end
|
135
135
|
end
|
136
136
|
end
|
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.
|
4
|
+
version: 0.12.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Groß
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -86,7 +86,6 @@ files:
|
|
86
86
|
- lib/rake/funnel/extensions/disable_colors.rb
|
87
87
|
- lib/rake/funnel/extensions/rexml.rb
|
88
88
|
- lib/rake/funnel/extensions/shell.rb
|
89
|
-
- lib/rake/funnel/extensions/windows_path.rb
|
90
89
|
- lib/rake/funnel/framework.rb
|
91
90
|
- lib/rake/funnel/integration/progress_report.rb
|
92
91
|
- lib/rake/funnel/integration/sync_output.rb
|
@@ -151,7 +150,6 @@ files:
|
|
151
150
|
- spec/rake/funnel/extensions/disable_colors_spec.rb
|
152
151
|
- spec/rake/funnel/extensions/rexml_spec.rb
|
153
152
|
- spec/rake/funnel/extensions/shell_spec.rb
|
154
|
-
- spec/rake/funnel/extensions/windows_path_spec.rb
|
155
153
|
- spec/rake/funnel/integration/progress_report_spec.rb
|
156
154
|
- spec/rake/funnel/integration/sync_output_spec.rb
|
157
155
|
- spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb
|
@@ -228,7 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
226
|
version: 1.3.1
|
229
227
|
requirements: []
|
230
228
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.0.
|
229
|
+
rubygems_version: 2.0.15
|
232
230
|
signing_key:
|
233
231
|
specification_version: 4
|
234
232
|
summary: The build pipeline
|
@@ -240,7 +238,6 @@ test_files:
|
|
240
238
|
- spec/rake/funnel/extensions/disable_colors_spec.rb
|
241
239
|
- spec/rake/funnel/extensions/rexml_spec.rb
|
242
240
|
- spec/rake/funnel/extensions/shell_spec.rb
|
243
|
-
- spec/rake/funnel/extensions/windows_path_spec.rb
|
244
241
|
- spec/rake/funnel/integration/progress_report_spec.rb
|
245
242
|
- spec/rake/funnel/integration/sync_output_spec.rb
|
246
243
|
- spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb
|