dap 0.1.18 → 0.1.20

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: 663523feb89fe2398a95fe119a2325a52400175b
4
- data.tar.gz: 672a9e854a7f3a9e8d3ee477d0e3b6e077111c62
3
+ metadata.gz: 8311c0f9e900cf884eff13a597b955673735c23e
4
+ data.tar.gz: d4431561b2ac5576b8ee42c1b794ede5839b5d84
5
5
  SHA512:
6
- metadata.gz: e8d53e2fe84af682bffe4474a8bf61e8d72adecdcd8c18dca0e76560d8467295cc85af2b1e0b9f0ce0e6d7f884d2d10de8741512d6a2a262706ebe5f97aa9e57
7
- data.tar.gz: 547b613736c776d94dbcc87abb467e62df5c6e246a0896d475a07ab0e6d98f6a3374b51455c2d8e985acb60134ea0d712c0cdf00453051bc969f70e1bc7f4a81
6
+ metadata.gz: 0b0191b8e6c69c47288c192a112ac7b0abe530dd8934b02a40b71c89e9e37c38db81650048e0ed8fb56006f3793ee86ebff7fbb3cbb9a2b5f913a9ecef26eddc
7
+ data.tar.gz: 1e9e2c7dcba583ef779cf882d25b6c5314be9b2a7d05a5d58ed55b3b4e26fb48567efbdfb424371d189231ff5cc0324c1974a334efefed35028d870f1205bdd8
data/README.md CHANGED
@@ -54,7 +54,7 @@ Uage: dap [input] + [filter] + [output]
54
54
 
55
55
  To see which input/output formats are supported and what filters are available, run `dap --inputs`,`dap --outputs` or `dap --filters`, respectively.
56
56
 
57
- This example reads as input a single IP address from `STDIN` in line form, applies geo-ip transofmrations as a filter on that line, and then returns the output as JSON:
57
+ This example reads as input a single IP address from `STDIN` in line form, applies geo-ip transformations as a filter on that line, and then returns the output as JSON:
58
58
 
59
59
  ```
60
60
  $ echo 8.8.8.8 | bin/dap + lines + geo_ip line + json
@@ -83,7 +83,17 @@ class FilterDecodeUPNP_SSDP_Reply
83
83
  include BaseDecoder
84
84
  def decode(data)
85
85
  head = { }
86
- data.split(/\n/).each do |line|
86
+ lines = data.split(/\r?\n/)
87
+ return if lines.empty?
88
+ if /^HTTP\/\d+\.\d+\s+(?<http_code>\d+)(?:\s+(?<http_message>.*))?/ =~ lines.first
89
+ head["upnp_http_code"] = http_code
90
+ head["upnp_http_message"] = http_message
91
+ else
92
+ return
93
+ end
94
+
95
+ lines.shift
96
+ lines.each do |line|
87
97
  k,v = line.strip.split(':', 2)
88
98
  next if not k
89
99
  head["upnp_#{k.downcase}"] = (v.to_s.strip)
@@ -64,8 +64,7 @@ module Input
64
64
  begin
65
65
  json = Oj.load(line.strip, mode: :strict)
66
66
  rescue
67
- $stderr.puts "\nRecord is not valid JSON and will be skipped."
68
- $stderr.puts line
67
+ $stderr.puts "Record is not valid JSON and will be skipped: '#{line}'"
69
68
  return Error::InvalidFormat
70
69
  end
71
70
  return Error::Empty unless json
@@ -78,4 +77,4 @@ end
78
77
  end
79
78
 
80
79
  require 'dap/input/warc'
81
- require 'dap/input/csv'
80
+ require 'dap/input/csv'
@@ -1,3 +1,3 @@
1
1
  module Dap
2
- VERSION = "0.1.18"
2
+ VERSION = "0.1.20"
3
3
  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.1.18
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rapid7 Research
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-27 00:00:00.000000000 Z
11
+ date: 2018-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  version: '0'
254
254
  requirements: []
255
255
  rubyforge_project:
256
- rubygems_version: 2.5.2
256
+ rubygems_version: 2.6.11
257
257
  signing_key:
258
258
  specification_version: 4
259
259
  summary: 'DAP: The Data Analysis Pipeline'