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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a79fe1801decfb148876ec544439c41ce4a7cc02
4
- data.tar.gz: 414df58e483da9b07ff3a97ba07929fb9aa8cd2c
3
+ metadata.gz: 3859342ac290358d762eb5f848ffdcecbe9f0874
4
+ data.tar.gz: efc1fe30abad9cc4b8d56d16125a5340d242eead
5
5
  SHA512:
6
- metadata.gz: 1d7af9bb07d2c85ee3850a8932a29843c3805a10ac0cd8550364d688a5c85f5f68c638c33e67cdd209c28b0137e7f363077e27e75776c14faafc53bd0682355f
7
- data.tar.gz: a45c7de5e10008ccdec23955e7984184124def50429fca7060ef6c77ed3266f9d53e330ea70cd07b78dba6b556281cdface1f7ada93fd0a3a37b715a29871051
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
@@ -1,3 +1,3 @@
1
1
  module MusicSanitizer
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -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.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: 2014-04-19 00:00:00.000000000 Z
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.1.8
96
+ rubygems_version: 2.4.8
98
97
  signing_key:
99
98
  specification_version: 4
100
99
  summary: Sanitizes music related data