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 +4 -4
- data/CHANGES.md +3 -0
- data/lib/discid.rb +1 -1
- data/lib/discid/version.rb +1 -1
- data/test/test_disc.rb +1 -1
- data/test/test_discid.rb +4 -1
- data/test/test_track.rb +1 -1
- metadata +2 -7
- data/.gitignore +0 -18
- data/.travis.yml +0 -18
- data/.yardopts +0 -1
- data/Gemfile +0 -4
- data/discid.gemspec +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da3abc81eca7a228d26984a9db667b91477ea068
|
4
|
+
data.tar.gz: d7fd697e3d2b833734417240b9be5919159338e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/discid.rb
CHANGED
@@ -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).
|
167
|
+
return (sectors.to_f / 75).truncate
|
168
168
|
end
|
169
169
|
|
170
170
|
# The libdiscid version.
|
data/lib/discid/version.rb
CHANGED
data/test/test_disc.rb
CHANGED
@@ -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 =
|
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,
|
data/test/test_discid.rb
CHANGED
@@ -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 =
|
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
|
data/test/test_track.rb
CHANGED
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.
|
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
|
+
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
data/.travis.yml
DELETED
@@ -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
data/discid.gemspec
DELETED
@@ -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
|