recog 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/recog/fingerprint.rb +1 -1
- data/lib/recog/version.rb +1 -1
- data/spec/data/whitespaced_fingerprint.xml +5 -0
- data/spec/lib/recog/fingerprint_spec.rb +12 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a661719e8af83d9afd786f25510ec87d01c96fd9
|
4
|
+
data.tar.gz: b70ff39d8f3daa85bc150ee9f16320b4367bf14b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9b2be07b4ed3ed0f589421e3fc6292b892eb930ee37f7f5d5f2cf86fbed0077ce863a9d08717155f9464e2242bbe1885e4db4f0d4a8d2b635224e08c94eb576
|
7
|
+
data.tar.gz: 170977c3716f1a3d4e4f90c5b08d484e762cbc281fdef8d0a66d01f76506b927d34fb3cc3617e88de92e9cf966563107c5f632671c4e1197e3634ee289c07c08
|
data/lib/recog/fingerprint.rb
CHANGED
@@ -128,7 +128,7 @@ class Fingerprint
|
|
128
128
|
# @return [String] Contents of the source XML's `description` tag
|
129
129
|
def parse_description(xml)
|
130
130
|
element = xml.xpath('description')
|
131
|
-
element.empty? ? '' : element.first.content.
|
131
|
+
element.empty? ? '' : element.first.content.to_s.gsub(/\s+/, ' ').strip
|
132
132
|
end
|
133
133
|
|
134
134
|
# @param xml [Nokogiri::XML::Element]
|
data/lib/recog/version.rb
CHANGED
@@ -1,5 +1,17 @@
|
|
1
|
+
require 'nokogiri'
|
1
2
|
require 'recog/fingerprint'
|
2
3
|
|
3
4
|
describe Recog::Fingerprint do
|
5
|
+
let(:xml) do
|
6
|
+
path = File.expand_path(File.join('spec', 'data', 'whitespaced_fingerprint.xml'))
|
7
|
+
doc = Nokogiri::XML(IO.read(path))
|
8
|
+
doc.xpath("//fingerprint").first
|
9
|
+
end
|
10
|
+
subject { Recog::Fingerprint.new(xml) }
|
4
11
|
|
12
|
+
describe "#name" do
|
13
|
+
it "properly squashes whitespace" do
|
14
|
+
expect(subject.name).to eq('I love whitespace!')
|
15
|
+
end
|
16
|
+
end
|
5
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rapid7 Research
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- spec/data/best_service_match_1.yml
|
165
165
|
- spec/data/smb_native_os.txt
|
166
166
|
- spec/data/test_fingerprints.xml
|
167
|
+
- spec/data/whitespaced_fingerprint.xml
|
167
168
|
- spec/lib/fingerprint_self_test_spec.rb
|
168
169
|
- spec/lib/recog/db_spec.rb
|
169
170
|
- spec/lib/recog/fingerprint/regexp_factory.rb
|