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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 104f7e365e635e684f6a1e955bcb5d86af5ffe3a
4
- data.tar.gz: 5f4d61e0c5934fb9b9af59b1a72cad20c1fc1173
3
+ metadata.gz: c3a23e580b78e0dfde266cffddec00f2442bc1da
4
+ data.tar.gz: 175e664d4f3262bb3d302a1a789912130e71c693
5
5
  SHA512:
6
- metadata.gz: 55bac4af92f58e7af91d4d2aeae1a670e415287538e784f7ccbe0d1b2ec30e2fca9d907b938c507bd96265babb31bd643d418fb9434e598001d0343c8cf4723e
7
- data.tar.gz: 508a833ca5711b4af150fb9f54e68ca91cf6e1faf69704a43e6e03288758b68365d9a69526c29f06a4d319f6338404412fa4543bfd4a4582a519ff080e38e65e
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
 
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Masamune
24
- VERSION = '0.15.3'
24
+ VERSION = '0.15.4'
25
25
  end
@@ -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
- before do
106
- instance.handle_stdout(input_row, 0)
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
- it { expect(buffer.string).to eq(output_row + "\n") }
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.3
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-19 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor