dap 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +8 -6
- data/lib/dap/filter/simple.rb +14 -0
- data/lib/dap/version.rb +1 -1
- data/spec/dap/filter/simple_filter_spec.rb +20 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 345b296a2b66392ec714ba4b7d90280811e36e74
|
4
|
+
data.tar.gz: 2995d4f2d34ba7ea6cfced467fc531ffd260780a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a988f816dcd30fe31b4719110cc059e192e840078cef435912d1f59fa1ff61641970d3e3155dd2b877acee1f43ec2d5b4038433ca4b686cd13930ea72d647c2
|
7
|
+
data.tar.gz: 60bb66d57c76286f96b6e18e8dacfaca07f79c22d4b965cf2f80b920cef596afeda5963699bec5787de39d98be8a405404185694c5897ba2bfbbef0e7196b18a
|
data/Gemfile
CHANGED
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.
|
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.
|
29
|
-
mini_portile2 (~> 2.
|
28
|
+
nokogiri (1.6.8)
|
29
|
+
mini_portile2 (~> 2.1.0)
|
30
|
+
pkg-config (~> 1.1.7)
|
30
31
|
oj (2.14.2)
|
31
|
-
|
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.
|
63
|
+
1.12.5
|
data/lib/dap/filter/simple.rb
CHANGED
@@ -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
@@ -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.
|
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-
|
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.
|
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:
|