mb-discid 0.1.3 → 0.1.4

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.
Files changed (4) hide show
  1. data/CHANGES +4 -1
  2. data/Rakefile +4 -4
  3. data/ext/mb_discid.c +10 -9
  4. metadata +44 -35
data/CHANGES CHANGED
@@ -1,5 +1,8 @@
1
1
  = Changelog
2
2
 
3
+ == 0.1.4 (2009-11-19)
4
+ * Fixed calling +read+ method without argument
5
+
3
6
  == 0.1.3 (2009-11-19)
4
7
  * Added singleton method +sectors_to_seconds+ to convert sectors into seconds
5
8
  * Added method +seconds+ to retrieve disc length in seconds
@@ -23,4 +26,4 @@
23
26
  == 0.1.0 (2007-06-02)
24
27
  * Initial release
25
28
 
26
- $Id: CHANGES 298 2009-11-19 09:26:45Z phw $
29
+ $Id: CHANGES 301 2009-11-19 11:39:31Z phw $
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: Rakefile 296 2009-11-18 22:09:36Z phw $
1
+ # $Id: Rakefile 300 2009-11-19 11:31:42Z phw $
2
2
  # Copyright (c) 2007, Philipp Wolfer
3
3
  # All rights reserved.
4
4
  # See LICENSE for permissions.
@@ -17,7 +17,7 @@ end
17
17
  # Packaging tasks: -------------------------------------------------------
18
18
 
19
19
  PKG_NAME = 'mb-discid'
20
- PKG_VERSION = '0.1.3'
20
+ PKG_VERSION = '0.1.4'
21
21
  PKG_SUMMARY = 'Ruby bindings for libdiscid.'
22
22
  PKG_AUTHOR = 'Philipp Wolfer'
23
23
  PKG_EMAIL = 'phw@rubyforge.org'
@@ -39,8 +39,8 @@ spec = Gem::Specification.new do |spec|
39
39
  spec.name = PKG_NAME
40
40
  spec.version = PKG_VERSION
41
41
  spec.summary = PKG_SUMMARY
42
- if ENV['BINARY_GEM'] == 'win32'
43
- spec.platform = Gem::Platform::WIN32
42
+ if ENV['BINARY_GEM']
43
+ spec.platform = Gem::Platform::CURRENT
44
44
  spec.files = PKG_FILES << 'ext/MB_DiscID.so'
45
45
  spec.bindir = 'bin'
46
46
  spec.required_ruby_version = ">= #{RUBY_VERSION}"
data/ext/mb_discid.c CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * $Id: mb_discid.c 297 2009-11-18 22:18:10Z phw $
2
+ * $Id: mb_discid.c 301 2009-11-19 11:39:31Z phw $
3
3
  *
4
4
  * Ruby bindings for libdiscid. See http://musicbrainz.org/doc/libdiscid
5
5
  * for more information on libdiscid and MusicBrainz.
@@ -186,7 +186,7 @@ static VALUE mb_discid_tracks(VALUE self)
186
186
  INT2FIX(discid_get_track_offset(disc, track)),
187
187
  INT2FIX(discid_get_track_length(disc, track)) );
188
188
 
189
- if (rb_block_given_p())
189
+ if (rb_block_given_p())
190
190
  rb_yield(tuple);
191
191
  else
192
192
  rb_ary_push(result, tuple);
@@ -221,17 +221,18 @@ static VALUE mb_discid_read(int argc, VALUE *argv, VALUE self)
221
221
  Data_Get_Struct(self, DiscId, disc);
222
222
 
223
223
  /* Check the number and types of arguments */
224
- rb_scan_args(argc, argv, "1", &device);
225
- if(rb_respond_to(device, rb_intern("to_s")))
226
- device = rb_funcall(device, rb_intern("to_s"), 0, 0);
227
- else
228
- rb_raise(rb_eTypeError, "wrong argument type (expected String)");
229
-
224
+ rb_scan_args(argc, argv, "01", &device);
225
+
230
226
  /* Use the default device if none was given. */
231
227
  if (device == Qnil)
232
228
  cdevice = discid_get_default_device();
233
- else
229
+ else if (rb_respond_to(device, rb_intern("to_s")))
230
+ {
231
+ device = rb_funcall(device, rb_intern("to_s"), 0, 0);
234
232
  cdevice = StringValuePtr(device);
233
+ }
234
+ else
235
+ rb_raise(rb_eTypeError, "wrong argument type (expected String)");
235
236
 
236
237
  /* Mark the disc id as unread in case something goes wrong. */
237
238
  rb_iv_set(self, "@read", Qfalse);
metadata CHANGED
@@ -1,34 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: mb-discid
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.1.3
7
- date: 2009-11-19 00:00:00 +01:00
8
- summary: Ruby bindings for libdiscid.
9
- require_paths:
10
- - lib
11
- - ext
12
- email: phw@rubyforge.org
13
- homepage: http://rbrainz.rubyforge.org
14
- rubyforge_project: rbrainz
15
- description: Ruby bindings for libdiscid. See http://musicbrainz.org/doc/libdiscid for more information on libdiscid and MusicBrainz.
16
- autorequire: mb-discid
17
- default_executable:
18
- bindir: bin
19
- has_rdoc: true
20
- required_ruby_version: !ruby/object:Gem::Version::Requirement
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: 1.8.6
25
- version:
4
+ version: 0.1.4
26
5
  platform: ruby
27
- signing_key:
28
- cert_chain:
29
- post_install_message:
30
6
  authors:
31
7
  - Philipp Wolfer
8
+ autorequire: mb-discid
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-11-19 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: " Ruby bindings for libdiscid. See http://musicbrainz.org/doc/libdiscid\n for more information on libdiscid and MusicBrainz.\n"
17
+ email: phw@rubyforge.org
18
+ executables: []
19
+
20
+ extensions:
21
+ - ext/extconf.rb
22
+ extra_rdoc_files:
23
+ - README
24
+ - LICENSE
25
+ - CHANGES
32
26
  files:
33
27
  - Rakefile
34
28
  - LICENSE
@@ -39,19 +33,34 @@ files:
39
33
  - ext/extconf.rb
40
34
  - lib/mb-discid.rb
41
35
  - test/test_discid.rb
42
- test_files: []
36
+ has_rdoc: true
37
+ homepage: http://rbrainz.rubyforge.org
38
+ licenses: []
43
39
 
40
+ post_install_message:
44
41
  rdoc_options: []
45
42
 
46
- extra_rdoc_files:
47
- - README
48
- - LICENSE
49
- - CHANGES
50
- executables: []
51
-
52
- extensions:
53
- - ext/extconf.rb
43
+ require_paths:
44
+ - lib
45
+ - ext
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 1.8.6
51
+ version:
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
54
58
  requirements:
55
59
  - libdiscid (http://musicbrainz.org/doc/libdiscid)
56
- dependencies: []
60
+ rubyforge_project: rbrainz
61
+ rubygems_version: 1.3.5
62
+ signing_key:
63
+ specification_version: 3
64
+ summary: Ruby bindings for libdiscid.
65
+ test_files: []
57
66