dap 0.0.11 → 0.0.12

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: e8a027b00cf9225a71e0a599704a788c23200f2c
4
- data.tar.gz: d5bf2864eb1ac5290a19bef4de11e76a3da5dcac
3
+ metadata.gz: 345b296a2b66392ec714ba4b7d90280811e36e74
4
+ data.tar.gz: 2995d4f2d34ba7ea6cfced467fc531ffd260780a
5
5
  SHA512:
6
- metadata.gz: 7e8aab164ce8b3be600320d2f9b32fe3da1ef76137efb6af3608bce035667b5b7422325a724dd232e105eabca7a47bdf81897a0ec2a6959bcffa45620f6c8154
7
- data.tar.gz: 4ceecd71b00e4fef27dd33434ef9e55cb0f96ed38310fc93fafee9c1a2e60949525cb302bb0722fef69147732cf6b922ec391cecf2cb6b9331e83c9211a6d114
6
+ metadata.gz: 6a988f816dcd30fe31b4719110cc059e192e840078cef435912d1f59fa1ff61641970d3e3155dd2b877acee1f43ec2d5b4038433ca4b686cd13930ea72d647c2
7
+ data.tar.gz: 60bb66d57c76286f96b6e18e8dacfaca07f79c22d4b965cf2f80b920cef596afeda5963699bec5787de39d98be8a405404185694c5897ba2bfbbef0e7196b18a
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ gem 'htmlentities'
5
5
  gem 'net-dns'
6
6
  gem 'bit-struct'
7
7
  gem 'geoip-c'
8
- gem 'recog', '>=2.0'
8
+ gem 'recog', '>=2.0.22'
9
9
 
10
10
  group :test do
11
11
  gem 'rspec', '~> 3.1.0'
data/Gemfile.lock CHANGED
@@ -21,14 +21,16 @@ GEM
21
21
  gherkin (2.12.2)
22
22
  multi_json (~> 1.3)
23
23
  htmlentities (4.3.4)
24
- mini_portile2 (2.0.0)
24
+ mini_portile2 (2.1.0)
25
25
  multi_json (1.11.2)
26
26
  multi_test (0.1.2)
27
27
  net-dns (0.8.0)
28
- nokogiri (1.6.7.1)
29
- mini_portile2 (~> 2.0.0.rc2)
28
+ nokogiri (1.6.8)
29
+ mini_portile2 (~> 2.1.0)
30
+ pkg-config (~> 1.1.7)
30
31
  oj (2.14.2)
31
- recog (2.0.17)
32
+ pkg-config (1.1.7)
33
+ recog (2.0.22)
32
34
  nokogiri
33
35
  rspec (3.1.0)
34
36
  rspec-core (~> 3.1.0)
@@ -54,8 +56,8 @@ DEPENDENCIES
54
56
  htmlentities
55
57
  net-dns
56
58
  oj
57
- recog (>= 2.0)
59
+ recog (>= 2.0.22)
58
60
  rspec (~> 3.1.0)
59
61
 
60
62
  BUNDLED WITH
61
- 1.10.6
63
+ 1.12.5
@@ -171,6 +171,20 @@ class FilterTransform
171
171
  end
172
172
  end
173
173
 
174
+ class FilterFlatten
175
+ include Base
176
+ def process(doc)
177
+ self.opts.each_pair do |k,|
178
+ if doc.has_key?(k) and doc[k].is_a?(Hash)
179
+ doc[k].each_pair do |fk,fv|
180
+ doc["#{k}.#{fk}"] = fv
181
+ end
182
+ end
183
+ end
184
+ [ doc ]
185
+ end
186
+ end
187
+
174
188
  class FilterTruncate
175
189
  include Base
176
190
  def process(doc)
data/lib/dap/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dap
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -0,0 +1,20 @@
1
+ describe Dap::Filter::FilterFlatten do
2
+ describe '.process' do
3
+
4
+ let(:filter) { described_class.new(["foo"]) }
5
+
6
+ context 'flatten nested json' do
7
+ let(:process) { filter.process({"foo" => {"bar" => "baz"}}) }
8
+ it 'has new flattened nested document keys' do
9
+ expect(process).to eq([{"foo" => {"bar" => "baz"}, "foo.bar" => "baz"}])
10
+ end
11
+ end
12
+
13
+ context 'ignore unnested keys' do
14
+ let(:process) { filter.process({"foo" => "bar"}) }
15
+ it 'is the same as the original document' do
16
+ expect(process).to eq([{"foo" => "bar"}])
17
+ end
18
+ end
19
+ end
20
+ 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.11
4
+ version: 0.0.12
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-08-22 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -221,6 +221,7 @@ files:
221
221
  - samples/udp-netbios.sh
222
222
  - spec/dap/filter/http_filter_spec.rb
223
223
  - spec/dap/filter/ldap_filter_spec.rb
224
+ - spec/dap/filter/simple_filter_spec.rb
224
225
  - spec/dap/proto/ipmi_spec.rb
225
226
  - spec/dap/proto/ldap_proto_spec.rb
226
227
  - spec/spec_helper.rb
@@ -249,14 +250,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
250
  version: '0'
250
251
  requirements: []
251
252
  rubyforge_project:
252
- rubygems_version: 2.2.5
253
+ rubygems_version: 2.6.6
253
254
  signing_key:
254
255
  specification_version: 4
255
256
  summary: 'DAP: The Data Analysis Pipeline'
256
257
  test_files:
257
258
  - spec/dap/filter/http_filter_spec.rb
258
259
  - spec/dap/filter/ldap_filter_spec.rb
260
+ - spec/dap/filter/simple_filter_spec.rb
259
261
  - spec/dap/proto/ipmi_spec.rb
260
262
  - spec/dap/proto/ldap_proto_spec.rb
261
263
  - spec/spec_helper.rb
262
- has_rdoc: