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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36f6999cb7287d4d466015d50c502be5330b1b9f
4
- data.tar.gz: 39ff7b7dbd08db306bd2c35d7058f5e8040b781e
3
+ metadata.gz: 9e840599bbad6c65fa1f7c4a6df934bcb1c3a35c
4
+ data.tar.gz: 1b2628551fc6d1ab3001084067c0b9e4a3ed2acc
5
5
  SHA512:
6
- metadata.gz: 3c5d779aae19fd7b39f427e151c218c3d54fa1ede5596018a485ce8e0c25a66bee9307a0c314be2a0239a9adcfd036316240a4de9d40d04285743f673fca7669
7
- data.tar.gz: 99acb8d19ce4458ac58636aaa2a5f31817000d6e11df4af086e1e59c73c0bb27bf5080cc937c2941961c713b4f3714ef32390fa6dad976d3ca946f143e2fd7ba
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 = Masamune::Commands::Shell.new(klass.new(self), {fail_fast: false}.merge(opts))
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('masamune') do |output|
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.new('masamune')
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.new('masamune').tap do |tmp|
177
+ @exec_file ||= Tempfile.create('masamune_hive_input').tap do |tmp|
176
178
  tmp.write(@exec)
177
- tmp.flush
179
+ tmp.close
178
180
  end.path
179
181
  end
180
182
 
@@ -146,9 +146,9 @@ module Masamune::Commands
146
146
  end
147
147
 
148
148
  def exec_file
149
- Tempfile.new('masamune').tap do |tmp|
149
+ @exec_file ||= Tempfile.create('masamune_psql_input').tap do |tmp|
150
150
  tmp.write(@exec)
151
- tmp.flush
151
+ tmp.close
152
152
  end.path
153
153
  end
154
154
 
@@ -147,7 +147,7 @@ module Masamune
147
147
  when :hdfs
148
148
  hadoop_fs('-touchz', *file_set)
149
149
  when :s3
150
- empty = Tempfile.new('masamune')
150
+ empty = Tempfile.new('masamune_empty')
151
151
  file_set.each do |file|
152
152
  s3cmd('put', empty.path, s3b(file, dir: false))
153
153
  end
@@ -52,7 +52,7 @@ module Masamune
52
52
 
53
53
  class << self
54
54
  def render_to_file(template, parameters = {})
55
- Tempfile.new('masamune').tap do |file|
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
@@ -42,7 +42,7 @@ module Masamune::Transform
42
42
  end
43
43
 
44
44
  def to_file
45
- Tempfile.new('masamune').tap do |file|
45
+ Tempfile.create('masamune_operator').tap do |file|
46
46
  file.write(to_s)
47
47
  file.close
48
48
  end.path
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Masamune
24
- VERSION = '0.17.7'
24
+ VERSION = '0.17.8'
25
25
  end
@@ -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.7
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-15 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor