ipod_db 0.2.10 → 0.2.11

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  NAME
5
5
  ====
6
6
 
7
- ipod_db v0.2.10
7
+ ipod_db v0.2.11
8
8
 
9
9
  SYNOPSIS
10
10
  ========
@@ -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
- return @length = TagLib::FileRef.open(absolute_path){|file| file.audio_properties.length}
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
@@ -1,3 +1,3 @@
1
1
  class IpodDB
2
- VERSION = '0.2.10'
2
+ VERSION = '0.2.11'
3
3
  end
@@ -53,6 +53,11 @@ describe Ipod::Track do
53
53
  assert_in_delta track.pos, Ipod::Track::SecondsPerTick
54
54
  end
55
55
 
56
+ it 'defaults to 0' do
57
+ track = Ipod::Track.new
58
+ assert_equal track.pos, 0
59
+ end
60
+
56
61
  end
57
62
 
58
63
  describe '#progress' do
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.10
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-17 00:00:00.000000000 Z
12
+ date: 2013-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bindata