dap 0.0.15 → 0.0.16

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: 9cfe15cbe33709ca867a29e172b4e98ca44004cf
4
- data.tar.gz: e16f1d7dfae75bb316516785daa13376106e1e23
3
+ metadata.gz: 9aa8ed86eb3fe80846ce7eb6640afa656cb22fea
4
+ data.tar.gz: 0dbd79d7cd7cb8cadd3a5c01726f22a368c39892
5
5
  SHA512:
6
- metadata.gz: 7157c20300dab7b56c40d6c0835c31e4af86d0a5cc28acbcc9ae58b89759ddb89ce90b5b59e13c53b2ec58391b842c18ee8550b0167bbe0695502005d70dba8b
7
- data.tar.gz: e065f1bb6931682336e875fdefae30a6414de5b54b1889de5356571148411cf7ffcce76ddef30253c948e7dd3fcb1c2432ea98dcb724b26f40cf2afe0945e28d
6
+ metadata.gz: f4cb1061d7576a340575f2381dd21f2e6b923b01cca20cef6755210e5eab55eee80546f62d8783194b3a8628bbd0d1eac0fe1020e7aaeca02d9050042613e8ce
7
+ data.tar.gz: 3698dbe8d69304448d723988e4a15a658cbdfb2f6b9a0786e560d17a856d0ca5cab0f173c3036ed0a3a4abfe9860001eede9d8b631295c87a503c8920527cbff
@@ -62,7 +62,7 @@ module Input
62
62
  line = self.fd.readline rescue nil
63
63
  return Error::EOF unless line
64
64
  begin
65
- json = Oj.load(line.strip)
65
+ json = Oj.load(line.strip, mode: :strict)
66
66
  rescue
67
67
  $stderr.puts "\nRecord is not valid JSON and will be skipped."
68
68
  $stderr.puts line
@@ -140,7 +140,7 @@ module Output
140
140
  end
141
141
 
142
142
  def write_record(doc)
143
- self.fd.puts Oj.dump(sanitize(doc))
143
+ self.fd.puts Oj.dump(sanitize(doc), mode: :strict)
144
144
  self.fd.flush
145
145
  end
146
146
 
@@ -1,3 +1,3 @@
1
1
  module Dap
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
@@ -0,0 +1,14 @@
1
+ describe Dap::Input::InputJSON do
2
+ describe '.read_record' do
3
+ context 'decoding input json' do
4
+ let(:file_object) { double("fake file") }
5
+ let(:input) { described_class.new(['data']) }
6
+ let(:record) { input.read_record }
7
+ it 'parses values starting with a colon (:) as a string' do
8
+ allow(File).to receive(:open).with('data', 'rb').and_return(file_object)
9
+ allow(file_object).to receive(:readline).and_return('{"a": ":b"}')
10
+ expect(record['a']).to eq(":b")
11
+ end
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rapid7 Research
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-29 00:00:00.000000000 Z
11
+ date: 2016-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -223,6 +223,7 @@ files:
223
223
  - spec/dap/filter/http_filter_spec.rb
224
224
  - spec/dap/filter/ldap_filter_spec.rb
225
225
  - spec/dap/filter/simple_filter_spec.rb
226
+ - spec/dap/input/json_spec.rb
226
227
  - spec/dap/proto/ipmi_spec.rb
227
228
  - spec/dap/proto/ldap_proto_spec.rb
228
229
  - spec/spec_helper.rb
@@ -251,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
252
  version: '0'
252
253
  requirements: []
253
254
  rubyforge_project:
254
- rubygems_version: 2.2.5
255
+ rubygems_version: 2.6.6
255
256
  signing_key:
256
257
  specification_version: 4
257
258
  summary: 'DAP: The Data Analysis Pipeline'
@@ -259,6 +260,7 @@ test_files:
259
260
  - spec/dap/filter/http_filter_spec.rb
260
261
  - spec/dap/filter/ldap_filter_spec.rb
261
262
  - spec/dap/filter/simple_filter_spec.rb
263
+ - spec/dap/input/json_spec.rb
262
264
  - spec/dap/proto/ipmi_spec.rb
263
265
  - spec/dap/proto/ldap_proto_spec.rb
264
266
  - spec/spec_helper.rb