music_sanitizer 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/music_sanitizer/processor.rb +4 -0
- data/lib/music_sanitizer/version.rb +1 -1
- data/spec/processor_spec.rb +4 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3859342ac290358d762eb5f848ffdcecbe9f0874
|
4
|
+
data.tar.gz: efc1fe30abad9cc4b8d56d16125a5340d242eead
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fd6e719a2a07c59a10c9572fc793b2e6d58309446a9046c7153cfae8257aa040ab0d8203e6abdd7523851f4e17383215cfbcb12979a0514d3d6097caf3ea077
|
7
|
+
data.tar.gz: 59c5182a69e6d6524851d6e136f25cda4239745abab06a89228021745190dfd641acc22d9a68905afc906e598576de6d082a5be6fb7ead57fba080b27ac934fc
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "yaml"
|
2
|
+
|
1
3
|
module MusicSanitizer
|
2
4
|
class Processor
|
3
5
|
IGNORE = YAML.load_file(File.join(MusicSanitizer.root, "lists/ignore.yml"))
|
@@ -40,6 +42,8 @@ module MusicSanitizer
|
|
40
42
|
string = string.gsub(reg, " ").strip
|
41
43
|
end
|
42
44
|
|
45
|
+
return if string.empty?
|
46
|
+
|
43
47
|
# Split
|
44
48
|
# A ft. B => A
|
45
49
|
string = string.split(/ft\.\s+/i).first
|
data/spec/processor_spec.rb
CHANGED
@@ -131,6 +131,10 @@ describe MusicSanitizer::Processor do
|
|
131
131
|
it "should handle '2ne1'" do
|
132
132
|
MusicSanitizer::Processor.new("2ne1").process.should eq("2ne1")
|
133
133
|
end
|
134
|
+
|
135
|
+
it "handles empty string" do
|
136
|
+
MusicSanitizer::Processor.new("").process.should be_nil
|
137
|
+
end
|
134
138
|
end
|
135
139
|
|
136
140
|
context "ignore?" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: music_sanitizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linus Oleander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,7 +60,6 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- .gitignore
|
63
|
-
- .rake_tasks~
|
64
63
|
- .rspec
|
65
64
|
- Gemfile
|
66
65
|
- LICENSE.txt
|
@@ -94,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
93
|
version: '0'
|
95
94
|
requirements: []
|
96
95
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
96
|
+
rubygems_version: 2.4.8
|
98
97
|
signing_key:
|
99
98
|
specification_version: 4
|
100
99
|
summary: Sanitizes music related data
|