discid 1.4.1 → 1.5.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
  SHA256:
3
- metadata.gz: 0c1f99777183d8decf97ffb214d424300ae1546f72d30e0a9fe3891e24b66882
4
- data.tar.gz: 65cc1ffde114bcd7860697ac081d266f434d294a86094a0f26efdd418096f1dc
3
+ metadata.gz: 3b7eeb3a5b61f7c5a9068287a395c0b8f1981049ee7bc48c0de3eef2f35f36c5
4
+ data.tar.gz: a45eeb079ec088cbb3bc2fbd045a051e23cfcd4f25151c6349830373b928fc12
5
5
  SHA512:
6
- metadata.gz: 6ccdebac904df0839af7ce5ad36d130e7c00d36324fabf72e64bdebf686bdb7a290c82d520dcd909b4b83295cc8ea0389540b66086b06e2f3a39646d277d70c1
7
- data.tar.gz: 6fe953875c071bd33973596c4bc9e18c1313a58df2273e4b929ca628e0923f79b93efa8bbf1c7fb26067278cf2f46588a3c2754a72b3f0febfb311b860725aa5
6
+ metadata.gz: 6a12087cd902fcd32bb2ceb4846c305e4ae76187578bd0c47d88e73a7d037ecbb954dc046dcf690f4b0ba852998a1d21d3068208efb18f16e3ca1923f607bc47
7
+ data.tar.gz: d0c24a5f783f66cbcb886e158108d4c44c91f47ec0faab8e180f7d7f76531205564b6f5a680ebcca70a0cafd7f5861b87b93694f85ee65af6f6bf6d90985a599
data/CHANGES.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.0 (2023-12-27)
4
+ * Added {DiscId::Track#to_h} for consistency with standard library. A backward
5
+ compatible alias {DiscId::Track#to_hash} is still available.
6
+ * Removed support for Ruby 1.8
7
+
3
8
  ## 1.4.1 (2021-09-23)
4
9
  * Fix Ruby 3 compatibility if {DiscId.tracks} gets called with a block
5
10
 
data/README.md CHANGED
@@ -14,7 +14,7 @@ ruby-discid will just return a default value. The version required for a feature
14
14
  is documented in the [API documentation](http://www.rubydoc.info/github/phw/ruby-discid/master).
15
15
 
16
16
  ## Requirements
17
- * Ruby >= 1.9.0
17
+ * Ruby >= 2.0
18
18
  * RubyGems >= 1.3.6
19
19
  * Ruby-FFI >= 1.6.0
20
20
  * libdiscid >= 0.1.0
@@ -111,7 +111,7 @@ Please report any issues on the
111
111
  [issue tracker](https://github.com/phw/ruby-discid/issues).
112
112
 
113
113
  ## License
114
- ruby-discid Copyright (c) 2007-2021 by Philipp Wolfer <ph.wolfer@gmail.com>
114
+ ruby-discid Copyright (c) 2007-2023 by Philipp Wolfer <ph.wolfer@gmail.com>
115
115
 
116
116
  ruby-discid is free software: you can redistribute it and/or modify
117
117
  it under the terms of the GNU Lesser General Public License as published by
data/lib/discid/track.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2008 - 2013 Philipp Wolfer
1
+ # Copyright (C) 2008-2023 Philipp Wolfer
2
2
  #
3
3
  # This program is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU Lesser General Public License as published by
@@ -117,7 +117,7 @@ module DiscId
117
117
  # Converts the Track into a Hash.
118
118
  #
119
119
  # @return [Hash]
120
- def to_hash
120
+ def to_h
121
121
  {
122
122
  :number => number,
123
123
  :sectors => sectors,
@@ -130,5 +130,6 @@ module DiscId
130
130
  }
131
131
  end
132
132
 
133
+ alias_method :to_hash, :to_h
133
134
  end
134
135
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013 Philipp Wolfer
1
+ # Copyright (C) 2013-2023 Philipp Wolfer
2
2
  #
3
3
  # This program is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU Lesser General Public License as published by
@@ -16,5 +16,5 @@
16
16
  #
17
17
  module DiscId
18
18
  # The version of ruby-discid.
19
- VERSION = "1.4.1"
19
+ VERSION = "1.5.0"
20
20
  end
data/test/test_discid.rb CHANGED
@@ -70,9 +70,9 @@ class TestDiscId < Test::Unit::TestCase
70
70
  end
71
71
 
72
72
  def test_put_invalid_track_count
73
- assert_raise(DiscId::DiscError) {
74
- disc = DiscId.put(1, @fiction_sectors, Array.new(101) {|i| i + 150 })
75
- }
73
+ assert_raise(DiscId::DiscError) do
74
+ DiscId.put(1, @fiction_sectors, Array.new(101) {|i| i + 150 })
75
+ end
76
76
  end
77
77
 
78
78
  # Test the tracks method and TrackInfo objects
data/test/test_track.rb CHANGED
@@ -43,17 +43,20 @@ class TestTrack < Test::Unit::TestCase
43
43
 
44
44
  def test_to_hash
45
45
  track = DiscId::Track.new @number, @offset, @length, @isrc
46
- hash = track.to_hash
47
46
 
48
- assert_equal track.number, hash[:number]
49
- assert_equal track.offset, hash[:offset]
50
- assert_equal track.sectors, hash[:sectors]
51
- assert_equal track.isrc, hash[:isrc]
47
+ for f in %i(to_h to_hash) do
48
+ hash = track.send(f)
52
49
 
53
- assert_equal track.end_sector, hash[:end_sector]
54
- assert_equal track.seconds, hash[:seconds]
55
- assert_equal track.start_time, hash[:start_time]
56
- assert_equal track.end_time, hash[:end_time]
50
+ assert_equal track.number, hash[:number]
51
+ assert_equal track.offset, hash[:offset]
52
+ assert_equal track.sectors, hash[:sectors]
53
+ assert_equal track.isrc, hash[:isrc]
54
+
55
+ assert_equal track.end_sector, hash[:end_sector]
56
+ assert_equal track.seconds, hash[:seconds]
57
+ assert_equal track.start_time, hash[:start_time]
58
+ assert_equal track.end_time, hash[:end_time]
59
+ end
57
60
  end
58
61
 
59
62
  def test_selector_access
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.1
4
+ version: 1.5.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: 2021-09-23 00:00:00.000000000 Z
11
+ date: 2023-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "<"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '0.18'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "<"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '0.18'
111
111
  description: ruby-discid provides Ruby bindings for the MusicBrainz DiscID library
112
112
  libdiscid. It allows calculating DiscIDs (MusicBrainz and freedb) for Audio CDs.
113
113
  Additionally the library can extract the MCN/UPC/EAN and the ISRCs from disc.
@@ -150,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
- version: 1.9.0
153
+ version: '2.0'
154
154
  required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - ">="
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: 1.3.6
159
159
  requirements:
160
160
  - libdiscid >= 0.1.0
161
- rubygems_version: 3.0.3.1
161
+ rubygems_version: 3.5.3
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Ruby bindings for libdiscid