discid 1.1.2 → 1.2.0

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: 28a65d260196225ba6d0e4f3f99ac8de7b4fa054
4
- data.tar.gz: 7fc412103cf18da05a9949f1fa703365540208cb
3
+ metadata.gz: da3abc81eca7a228d26984a9db667b91477ea068
4
+ data.tar.gz: d7fd697e3d2b833734417240b9be5919159338e3
5
5
  SHA512:
6
- metadata.gz: 976957eecadb7488e4ed07c4702756580b7c419759828e12d9f8fc0245510c5266e499190bc3826f274dd645f97573b939717848f1b356d73f0008ea3511a5e7
7
- data.tar.gz: c2f6517c1667b01de92ef23ff0beaf35fb8146eecce16772b715094f4ddf7f558541136ce4c8108e66a6e504dc9def1172dc6a5641a5b68b4cd979840ecff4b6
6
+ metadata.gz: 22ae22372a5d41b633eef98a56609f5dd8f5152e140c922fef1b606ce62a4ae57acec27005f317ef633f3879455f0df0ba76df24cf885dd9a8b77f40885e1af5
7
+ data.tar.gz: a9761bc666fa56fb5e16112911e3536d702cf69722037b155390217e9e180950754bd2f922568c752c81bf0a7ee93507eb0a1e20bb7a649a7441bed3c975b29f
data/CHANGES.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0 (2016-02-12)
4
+ * `DiscId.sectors_to_seconds`: Truncate instead of round resulting float
5
+
3
6
  ## 1.1.2 (2016-02-11)
4
7
  * Fixed first and last track being swapped in example readdiscid.rb
5
8
  * Restricted dependencies for Ruby 1.8 to maintain compatibility
@@ -164,7 +164,7 @@ module DiscId
164
164
  # @param sectors [Integer] Number of sectors
165
165
  # @return [Integer] The seconds
166
166
  def self.sectors_to_seconds(sectors)
167
- return (sectors.to_f / 75).round
167
+ return (sectors.to_f / 75).truncate
168
168
  end
169
169
 
170
170
  # The libdiscid version.
@@ -16,5 +16,5 @@
16
16
 
17
17
  module DiscId
18
18
  # The version of ruby-discid.
19
- VERSION = "1.1.2"
19
+ VERSION = "1.2.0"
20
20
  end
@@ -25,7 +25,7 @@ class TestDisc < Test::Unit::TestCase
25
25
  @fiction_first_track = 1
26
26
  @fiction_last_track = 10
27
27
  @fiction_sectors = 206535
28
- @fiction_seconds = 2754
28
+ @fiction_seconds = 2753
29
29
  @fiction_offsets = [150, 18901, 39738, 59557, 79152, 100126,
30
30
  124833, 147278, 166336, 182560]
31
31
  @fiction_lengths = [18751, 20837, 19819, 19595, 20974,
@@ -35,7 +35,7 @@ class TestDiscId < Test::Unit::TestCase
35
35
  @fiction_first_track = 1
36
36
  @fiction_last_track = 10
37
37
  @fiction_sectors = 206535
38
- @fiction_seconds = 2754
38
+ @fiction_seconds = 2753
39
39
  @fiction_offsets = [150, 18901, 39738, 59557, 79152, 100126,
40
40
  124833, 147278, 166336, 182560]
41
41
  @fiction_lengths = [18751, 20837, 19819, 19595, 20974,
@@ -118,6 +118,9 @@ class TestDiscId < Test::Unit::TestCase
118
118
  assert_equal 0, DiscId.sectors_to_seconds(0)
119
119
  assert_equal @fiction_seconds,
120
120
  DiscId.sectors_to_seconds(@fiction_sectors)
121
+ assert_equal 1, DiscId.sectors_to_seconds(75)
122
+ assert_equal 1, DiscId.sectors_to_seconds(75+74)
123
+ assert_equal 2, DiscId.sectors_to_seconds(75+75)
121
124
  end
122
125
 
123
126
  def test_has_feature
@@ -37,7 +37,7 @@ class TestTrack < Test::Unit::TestCase
37
37
 
38
38
  assert_equal @offset + @length, track.end_sector
39
39
  assert_equal 315, track.seconds
40
- assert_equal 14, track.start_time
40
+ assert_equal 13, track.start_time
41
41
  assert_equal 329, track.end_time
42
42
  end
43
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Wolfer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-11 00:00:00.000000000 Z
11
+ date: 2016-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -117,15 +117,10 @@ executables: []
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
- - ".gitignore"
121
- - ".travis.yml"
122
- - ".yardopts"
123
120
  - CHANGES.md
124
- - Gemfile
125
121
  - LICENSE
126
122
  - README.md
127
123
  - Rakefile
128
- - discid.gemspec
129
124
  - examples/discidinfo.rb
130
125
  - examples/readdiscid.rb
131
126
  - lib/discid.rb
data/.gitignore DELETED
@@ -1,18 +0,0 @@
1
- *.gem
2
- *.rbc
3
- *~
4
- .bundle
5
- .config
6
- .yardoc
7
- Gemfile.lock
8
- InstalledFiles
9
- _yardoc
10
- coverage
11
- doc/
12
- lib/bundler/man
13
- pkg
14
- rdoc
15
- spec/reports
16
- test/tmp
17
- test/version_tmp
18
- tmp
@@ -1,18 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- rvm:
4
- - 1.8.7
5
- - 1.9.3
6
- - 2.0.0
7
- - 2.1.0
8
- - 2.2.3
9
- - 2.3.0
10
- - jruby-18mode # JRuby in 1.8 mode
11
- - jruby-19mode # JRuby in 1.9 mode
12
- - rbx-2
13
- addons:
14
- apt:
15
- packages:
16
- - libdiscid0
17
- sudo: false
18
- script: CODECLIMATE_REPO_TOKEN=40f40f3d9e79b5e7051d7564172541932d6799ba585a5ada684695c0fb3e5e5e bundle exec rake test
data/.yardopts DELETED
@@ -1 +0,0 @@
1
- --no-private --markup markdown --markup-provider kramdown - CHANGES
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in discid.gemspec
4
- gemspec
@@ -1,41 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'discid/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "discid"
8
- spec.version = DiscId::VERSION
9
- spec.authors = ["Philipp Wolfer"]
10
- spec.email = ["ph.wolfer@gmail.com"]
11
- spec.description = %q{ruby-discid provides Ruby bindings for the MusicBrainz DiscID library libdiscid. It allows calculating DiscIDs (MusicBrainz and freedb) for Audio CDs. Additionally the library can extract the MCN/UPC/EAN and the ISRCs from disc.}
12
- spec.summary = %q{Ruby bindings for libdiscid}
13
- spec.homepage = "https://github.com/phw/ruby-discid"
14
- spec.license = "LGPL-3"
15
- spec.post_install_message = %q{Please make sure you have libdiscid (http://musicbrainz.org/doc/libdiscid) installed.}
16
-
17
- spec.requirements = "libdiscid >= 0.1.0"
18
- spec.required_ruby_version = ">= 1.8.7"
19
- spec.required_rubygems_version = ">= 1.3.6"
20
-
21
- spec.files = `git ls-files`.split($/)
22
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
23
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
24
- spec.require_paths = ["lib"]
25
-
26
- spec.add_dependency "ffi", ">= 1.6.0"
27
-
28
- spec.add_development_dependency "bundler", ">= 1.3"
29
- spec.add_development_dependency "yard"
30
- spec.add_development_dependency "kramdown"
31
-
32
- # The code coverage is only supported for Ruby >= 1.9
33
- if (RUBY_VERSION.split('.').map{|s|s.to_i} <=> [1, 9, 0]) >= 0
34
- spec.add_development_dependency "rake"
35
- spec.add_development_dependency "test-unit"
36
- spec.add_development_dependency "codeclimate-test-reporter"
37
- else
38
- spec.add_development_dependency "rake", "~> 10.4.0"
39
- spec.add_development_dependency "test-unit", "~> 3.1.0", "< 3.1.4"
40
- end
41
- end