masamune 0.17.7 → 0.17.8
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/masamune/actions/execute.rb +3 -1
- data/lib/masamune/actions/transform.rb +1 -1
- data/lib/masamune/commands/hive.rb +5 -3
- data/lib/masamune/commands/postgres.rb +2 -2
- data/lib/masamune/filesystem.rb +1 -1
- data/lib/masamune/template.rb +1 -1
- data/lib/masamune/transform/operator.rb +1 -1
- data/lib/masamune/version.rb +1 -1
- data/spec/masamune/actions/execute_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e840599bbad6c65fa1f7c4a6df934bcb1c3a35c
|
4
|
+
data.tar.gz: 1b2628551fc6d1ab3001084067c0b9e4a3ed2acc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cc39b250d065e9dc2c99734d6e54cc2cc91c9ac44b929ef1173df9062642d1bf9367f5e63d90749d7da11b0b8f5fe2a0ad3b79394623d3afca4c69e3a4c357e
|
7
|
+
data.tar.gz: f89b374c5ba7ed50549aea63c3933e5276029b323d7f6f75aa8cbd532f33170ad8651512c829e844095e74d61c3a4b23ff9269f9a6088b40b549bd2841d5ced6
|
@@ -56,7 +56,9 @@ module Masamune::Actions
|
|
56
56
|
end
|
57
57
|
end if block_given?
|
58
58
|
|
59
|
-
command =
|
59
|
+
command = klass.new(self)
|
60
|
+
command = Masamune::Commands::RetryWithBackoff.new(command, opts)
|
61
|
+
command = Masamune::Commands::Shell.new(command, {fail_fast: false}.merge(opts))
|
60
62
|
opts.fetch(:interactive, false) ? command.replace(opts) : command.execute
|
61
63
|
end
|
62
64
|
end
|
@@ -86,7 +86,7 @@ module Masamune::Actions
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def apply_map(map, source_files, source, target)
|
89
|
-
Tempfile.open('
|
89
|
+
Tempfile.open('masamune_transform') do |output|
|
90
90
|
begin
|
91
91
|
FileUtils.chmod(FILE_MODE, output.path)
|
92
92
|
result = map.apply(source_files, output)
|
@@ -97,7 +97,7 @@ module Masamune::Commands
|
|
97
97
|
end
|
98
98
|
|
99
99
|
if @output
|
100
|
-
@buffer = Tempfile.
|
100
|
+
@buffer = Tempfile.create('masamune_hive_output')
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
@@ -114,6 +114,8 @@ module Masamune::Commands
|
|
114
114
|
return unless @output
|
115
115
|
|
116
116
|
filesystem.move_file_to_file(@buffer.path, @output)
|
117
|
+
ensure
|
118
|
+
File.delete(@buffer.path) if @buffer && @buffer.path && File.exists?(@buffer.path)
|
117
119
|
end
|
118
120
|
|
119
121
|
def handle_stdout(line, line_no)
|
@@ -172,9 +174,9 @@ module Masamune::Commands
|
|
172
174
|
end
|
173
175
|
|
174
176
|
def exec_file
|
175
|
-
Tempfile.
|
177
|
+
@exec_file ||= Tempfile.create('masamune_hive_input').tap do |tmp|
|
176
178
|
tmp.write(@exec)
|
177
|
-
tmp.
|
179
|
+
tmp.close
|
178
180
|
end.path
|
179
181
|
end
|
180
182
|
|
data/lib/masamune/filesystem.rb
CHANGED
data/lib/masamune/template.rb
CHANGED
@@ -52,7 +52,7 @@ module Masamune
|
|
52
52
|
|
53
53
|
class << self
|
54
54
|
def render_to_file(template, parameters = {})
|
55
|
-
Tempfile.
|
55
|
+
Tempfile.create('masamune_template').tap do |file|
|
56
56
|
file.write(render_to_string(template, parameters))
|
57
57
|
file.close
|
58
58
|
end.path
|
data/lib/masamune/version.rb
CHANGED
@@ -39,6 +39,10 @@ describe Masamune::Actions::Execute do
|
|
39
39
|
let(:instance) { klass.new }
|
40
40
|
|
41
41
|
describe '.execute' do
|
42
|
+
before do
|
43
|
+
expect(Masamune::Commands::RetryWithBackoff).to receive(:new).with(anything, anything).once.and_call_original
|
44
|
+
end
|
45
|
+
|
42
46
|
context 'with a simple command' do
|
43
47
|
let(:command) { %w(echo ping) }
|
44
48
|
let(:options) { {fail_fast: true} }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: masamune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Andrews
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|