tagomatic 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -30,7 +30,7 @@ module Tagomatic
30
30
  regexp << Regexp.escape(tail)
31
31
  end
32
32
 
33
- compiled = Regexp.compile(regexp)
33
+ compiled = Regexp.compile(regexp, Regexp::IGNORECASE)
34
34
  @format_matcher_factory.create_format_matcher(compiled, tag_mapping, format)
35
35
  end
36
36
 
@@ -4,40 +4,40 @@ module Tagomatic
4
4
 
5
5
  KNOWN_FORMATS = [
6
6
  "%g/%a/%b/Disc%d/%n-%t.mp3",
7
+ "%g/%a/%b/Disc%d/%n.%t.mp3",
7
8
  "%g/%a/%b/Disc%d/%n%t.mp3",
8
9
  "%g/%a/%b/Disc%d/%t.mp3",
9
- "%g/%a/%b/CD%d/%n-%t.mp3",
10
- "%g/%a/%b/CD%d/%n%t.mp3",
11
- "%g/%a/%b/CD%d/%t.mp3",
12
10
  "%g/%a/%b/cd%d/%n-%t.mp3",
11
+ "%g/%a/%b/cd%d/%n.%t.mp3",
13
12
  "%g/%a/%b/cd%d/%n%t.mp3",
14
13
  "%g/%a/%b/cd%d/%t.mp3",
15
14
 
16
15
  "%g/%a/%b[%y]/%a-%b-%n-%t.mp3",
17
16
  "%g/%a/%b[%y]/%n-%t.mp3",
17
+ "%g/%a/%b[%y]/%n.%t.mp3",
18
18
  "%g/%a/%b[%y]/%n%t.mp3",
19
19
 
20
20
  "%g/%a/%b(%y)/%a-%b-%n-%t.mp3",
21
21
  "%g/%a/%b(%y)/%n-%t.mp3",
22
+ "%g/%a/%b(%y)/%n.%t.mp3",
22
23
  "%g/%a/%b(%y)/%n%t.mp3",
23
24
 
24
25
  "%g/%a/(%y)%b/%a-%b-%n-%t.mp3",
25
26
  "%g/%a/(%y)%b/%n-%t.mp3",
27
+ "%g/%a/(%y)%b/%n.%t.mp3",
26
28
  "%g/%a/(%y)%b/%n%t.mp3",
27
29
 
28
30
  "%g/%a/%y - %b/%a-%b-%n-%t.mp3",
29
31
  "%g/%a/%y - %b/%n-%t.mp3",
32
+ "%g/%a/%y - %b/%n.%t.mp3",
30
33
  "%g/%a/%y - %b/%n%t.mp3",
31
34
 
32
35
  "%g/%a/%b/%a-%b-%n-%t.mp3",
33
- "%g/%a/%b/%a-%b-%n-%t.MP3",
34
36
  "%g/%a/%b/%n-%t.mp3",
35
- "%g/%a/%b/%n-%t.MP3",
37
+ "%g/%a/%b/%n.%t.mp3",
36
38
  "%g/%a/%b/%n%t.mp3",
37
- "%g/%a/%b/%n%t.MP3",
38
39
 
39
40
  "%g/%a/%b/%t.mp3",
40
- "%g/%a/%b/%t.MP3",
41
41
  ]
42
42
 
43
43
  end
@@ -65,7 +65,7 @@ module Tagomatic
65
65
  def read_local_options
66
66
  local_options = []
67
67
  matcher = @local_options_matcher_factory.create_local_options_matcher
68
- lines = File.readlines(determine_local_config_file_path)
68
+ lines = File.readlines(determine_local_config_file_path).map {|line| line.chomp}
69
69
  lines.each do |line|
70
70
  matcher.process!(line)
71
71
  local_options.concat matcher.to_argv
@@ -119,6 +119,8 @@ module Tagomatic
119
119
  end
120
120
 
121
121
  def normalize_tags
122
+ return if @tags.nil? or @tags.empty?
123
+
122
124
  normalized = Hash.new
123
125
  @tags.each do |tag, value|
124
126
  next if value.nil?
@@ -153,7 +155,7 @@ module Tagomatic
153
155
  apply_tags
154
156
  show_tags if @options[:showtags]
155
157
  ensure
156
- close_mp3file
158
+ try_closeing_mp3file
157
159
  end
158
160
 
159
161
  def open_mp3file
@@ -207,6 +209,12 @@ module Tagomatic
207
209
  puts output
208
210
  end
209
211
 
212
+ def try_closeing_mp3file
213
+ close_mp3file
214
+ rescue
215
+ show_error "failed closing #{@file_path} - file probably not updated", $!
216
+ end
217
+
210
218
  def close_mp3file
211
219
  @mp3.close
212
220
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tagomatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lukic
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-02 00:00:00 +01:00
12
+ date: 2009-11-03 00:00:00 +01:00
13
13
  default_executable: tagomatic
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency