mp3filename 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README +54 -0
  2. data/bin/mp3filename +6 -0
  3. data/lib/mp3filename.rb +25 -0
  4. metadata +64 -0
data/README ADDED
@@ -0,0 +1,54 @@
1
+ = mp3filename
2
+
3
+ http://www.github.com/railsfreak/mp3filename
4
+
5
+ == DESCRIPTION:
6
+
7
+
8
+ == FEATURES/PROBLEMS:
9
+
10
+
11
+ == SYNOPSIS:
12
+
13
+
14
+ == REQUIREMENTS:
15
+
16
+ ruby-mp3info
17
+
18
+ == INSTALL:
19
+
20
+ sudo gem install mp3filename
21
+
22
+ == DEVELOPERS:
23
+
24
+ After checking out the source, run:
25
+
26
+ $ rake newb
27
+
28
+ This task will install any missing dependencies, run the tests/specs,
29
+ and generate the RDoc.
30
+
31
+ == LICENSE:
32
+
33
+ (The MIT License)
34
+
35
+ Copyright (c) 2013 FIX
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining
38
+ a copy of this software and associated documentation files (the
39
+ 'Software'), to deal in the Software without restriction, including
40
+ without limitation the rights to use, copy, modify, merge, publish,
41
+ distribute, sublicense, and/or sell copies of the Software, and to
42
+ permit persons to whom the Software is furnished to do so, subject to
43
+ the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be
46
+ included in all copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
49
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
50
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
51
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
52
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
53
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
54
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/bin/mp3filename ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'mp3filename'
4
+
5
+
6
+ Mp3FileName.new(ARGV[0]).change
@@ -0,0 +1,25 @@
1
+ require 'mp3info'
2
+
3
+ class Mp3Error < StandardError; end;
4
+
5
+ class Mp3FileName
6
+ VERSION = "1.0.0"
7
+
8
+ def initialize(path)
9
+ @path = path
10
+ end
11
+
12
+ def change
13
+ begin
14
+ Dir["#{@path}/*.mp3"].each do |file|
15
+ Mp3Info.open(file) do |mp3|
16
+ title = mp3.tag.title.strip
17
+ title.empty? ? file.gsub!(/^\d*_*/,'') : FileUtils.mv("#{file}", "#{title}.mp3")
18
+ puts "Title changed to : #{title == file ? file : title}"
19
+ end
20
+ end
21
+ rescue
22
+ #raise Mp3Error, "An Unknown error has occured..."
23
+ end
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mp3filename
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Manoj Mishra
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: ruby-mp3info
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: Mp3 File Name is a utility to rename mp3 files to their title
31
+ email: b0rn2c0d3@gmail.com
32
+ executables:
33
+ - mp3filename
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - README
38
+ - lib/mp3filename.rb
39
+ - bin/mp3filename
40
+ homepage: https://github.com/railsfreak/mp3filename
41
+ licenses: []
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubyforge_project:
60
+ rubygems_version: 1.8.24
61
+ signing_key:
62
+ specification_version: 3
63
+ summary: Mp3 File Name is a utility to rename mp3 files to their title
64
+ test_files: []