ipod_db 0.2.10 → 0.2.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/ipod/track.rb +5 -2
- data/lib/ipod_db/version.rb +1 -1
- data/spec/ipod/track_spec.rb +5 -0
- metadata +2 -2
data/README.md
CHANGED
data/lib/ipod/track.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'ostruct'
|
2
2
|
require 'taglib'
|
3
3
|
require 'fileutils'
|
4
|
+
require 'active_support/core_ext/kernel/reporting'
|
4
5
|
|
5
6
|
module Ipod
|
6
7
|
class Track < OpenStruct
|
@@ -24,7 +25,7 @@ module Ipod
|
|
24
25
|
end
|
25
26
|
|
26
27
|
def pos
|
27
|
-
Track.ticks_to_sec(bookmarktime)
|
28
|
+
Track.ticks_to_sec(bookmarktime || 0.0)
|
28
29
|
end
|
29
30
|
|
30
31
|
def length
|
@@ -37,7 +38,9 @@ module Ipod
|
|
37
38
|
old_stat = File::Stat.new(absolute_path)
|
38
39
|
begin
|
39
40
|
FileUtils.chmod('a-w', absolute_path)
|
40
|
-
|
41
|
+
quietly {
|
42
|
+
return @length = TagLib::FileRef.open(absolute_path){|file| file.audio_properties.length}
|
43
|
+
}
|
41
44
|
ensure
|
42
45
|
FileUtils.chmod(old_stat.mode, absolute_path)
|
43
46
|
end
|
data/lib/ipod_db/version.rb
CHANGED
data/spec/ipod/track_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ipod_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bindata
|