masamune 0.15.3 → 0.15.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/masamune/commands/hive.rb +2 -1
- data/lib/masamune/version.rb +1 -1
- data/spec/masamune/commands/hive_spec.rb +14 -5
- 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: c3a23e580b78e0dfde266cffddec00f2442bc1da
|
4
|
+
data.tar.gz: 175e664d4f3262bb3d302a1a789912130e71c693
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2422f0c4406e4543a1f88f0843b4579c945861766a684c942d5dac09ab1f88ff42f85547b1f93937f8976e1a038ece71ec43a735c0246c745b7c8b13ed2315f7
|
7
|
+
data.tar.gz: b23f898f4883cc7704b81c324751d017894acc1e6f5ce5e3f4e8285084ac812b160a0a41e894875f91f97ae8521437897c327f1f3130377c2dfbec1a411b61a1
|
@@ -115,10 +115,11 @@ module Masamune::Commands
|
|
115
115
|
filesystem.move_file_to_file(@buffer.path, @output)
|
116
116
|
end
|
117
117
|
|
118
|
-
# FIXME use temporary tables with delimiters for CSV output format
|
119
118
|
def handle_stdout(line, line_no)
|
120
119
|
if line =~ /\A#{PROMPT}/
|
121
120
|
logger.debug(line)
|
121
|
+
elsif line =~ /\AQuery returned non-zero code:/
|
122
|
+
raise SystemExit, line
|
122
123
|
else
|
123
124
|
@block.call(line) if @block
|
124
125
|
|
data/lib/masamune/version.rb
CHANGED
@@ -99,13 +99,22 @@ describe Masamune::Commands::Hive do
|
|
99
99
|
let(:buffer) { StringIO.new }
|
100
100
|
let(:delimiter) { "\t" }
|
101
101
|
let(:attrs) { {buffer: buffer, delimiter: delimiter, csv: true} }
|
102
|
-
let(:input_row) { ['A', 'NULL', 'B', 'C', '', 'E'].join(delimiter) }
|
103
|
-
let(:output_row) { ['A', nil, 'B', 'C', nil, 'E'].join(',') }
|
104
102
|
|
105
|
-
|
106
|
-
|
103
|
+
context 'encode NULL' do
|
104
|
+
let(:input_row) { ['A', 'NULL', 'B', 'C', '', 'E'].join(delimiter) }
|
105
|
+
let(:output_row) { ['A', nil, 'B', 'C', nil, 'E'].join(',') }
|
106
|
+
|
107
|
+
before do
|
108
|
+
instance.handle_stdout(input_row, 0)
|
109
|
+
end
|
110
|
+
|
111
|
+
it { expect(buffer.string).to eq(output_row + "\n") }
|
107
112
|
end
|
108
113
|
|
109
|
-
|
114
|
+
context 'non zero exit' do
|
115
|
+
let(:input_row) { 'Query returned non-zero code: 1, cause: Problem compiling' }
|
116
|
+
|
117
|
+
it { expect { instance.handle_stdout(input_row, 0) }.to raise_error(SystemExit, input_row) }
|
118
|
+
end
|
110
119
|
end
|
111
120
|
end
|
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.15.
|
4
|
+
version: 0.15.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Andrews
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|