licensee 5.0.0b5 → 5.0.0b6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3141e0f1cc301cf2aebb6f835212533eafe27316
4
- data.tar.gz: 3fac37012f662fd0520b99106793d3b43bafce61
3
+ metadata.gz: e0124d7811751a1221aa8ba861192a36432f23fe
4
+ data.tar.gz: b01c35d07fc8db789ec3bd4af74ae8834a88c702
5
5
  SHA512:
6
- metadata.gz: bc48939cb0de92f1305b7e341b01da174c298b262ec58a1f6a7ed66298a1d4f68ecfbb1dc870e64cab51bb75298b643a66770c3590b666d2c3cdf7a8881049d3
7
- data.tar.gz: 8f8350d224fa1cb4f18661a3a42c876e2dd450670de6f3888b8cbeef6a9a8ffdbe7ab635b8702b27b179b92115cf7defe32436b51bb7ee25a74ea7d8b440f474
6
+ metadata.gz: 50f59b2e3ea125d6016a071aeeb585f7555e0920ee2ab3a7ee3118af086d9cf8ace3d9db578cdeea36e9dfde40139f49ef26a804146e0d4488823f1193ca6891
7
+ data.tar.gz: 7ce11976be77d28769c878bdbc382506f4ad17d3785ba4c3d54df7359a6651d5e779cdd96e79d83d78a4302cd4403a53d2da1581099cade778fd8507986036f0
@@ -7,6 +7,7 @@ class Licensee
7
7
  content = content.gsub(/[[:space:]]+\z/, '')
8
8
  content = content.gsub(/^#{CopyrightMatcher::REGEX}$/i, '')
9
9
  content = content.gsub(/[[:space:]]+/, ' ')
10
+ content = content.gsub("\u0000", '') # Remove null byte which breaks Levenshtein
10
11
  content.squeeze(' ').strip
11
12
  end
12
13
  end
@@ -1,3 +1,3 @@
1
1
  class Licensee
2
- VERSION = "5.0.0b5"
2
+ VERSION = "5.0.0b6"
3
3
  end
@@ -33,4 +33,8 @@ class TestLicenseeContentHelper < Minitest::Test
33
33
  should "strip copyrights" do
34
34
  assert_equal "foo", normalize("Copyright (c) 2015 Ben Balter\nFoo")
35
35
  end
36
+
37
+ should "strip null bytes" do
38
+ assert_equal "foo", normalize("\u0000Foo")
39
+ end
36
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: licensee
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0b5
4
+ version: 5.0.0b6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter