mb-discid 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,10 @@
1
1
  = Changelog
2
2
 
3
+ == 0.1.5 (2011-07-02)
4
+ * Added binding for get_webservice_url()
5
+ * Add lib path detection, allows out-of-the-box install when your
6
+ libdiscid is in /usr/local (Matt Patterson)
7
+
3
8
  == 0.1.4 (2009-11-19)
4
9
  * Fixed calling +read+ method without argument
5
10
 
@@ -26,4 +31,4 @@
26
31
  == 0.1.0 (2007-06-02)
27
32
  * Initial release
28
33
 
29
- $Id: CHANGES 301 2009-11-19 11:39:31Z phw $
34
+ $Id: CHANGES 333 2011-07-02 13:41:07Z phw $
data/README CHANGED
@@ -7,7 +7,7 @@ to find the release entry for your CD in the MusicBrainz database.
7
7
 
8
8
  == Requirements
9
9
  * Ruby >= 1.8.6
10
- * libdiscid >= 0.1.0
10
+ * libdiscid >= 0.2.2
11
11
 
12
12
  == Installation
13
13
  Before installing rdiscid make sure you have libdiscid installed. See
@@ -51,4 +51,4 @@ MB-DiscID is Copyright (c) 2007 Philipp Wolfer.
51
51
  It is free softare distributed under a BSD style license. See
52
52
  LICENSE[link:files/LICENSE.html] for details.
53
53
 
54
- $Id: README 298 2009-11-19 09:26:45Z phw $
54
+ $Id: README 315 2010-06-14 21:30:06Z phw $
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # $Id: Rakefile 300 2009-11-19 11:31:42Z phw $
1
+ # $Id: Rakefile 330 2011-07-02 13:12:30Z 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.4'
20
+ PKG_VERSION = '0.1.5'
21
21
  PKG_SUMMARY = 'Ruby bindings for libdiscid.'
22
22
  PKG_AUTHOR = 'Philipp Wolfer'
23
23
  PKG_EMAIL = 'phw@rubyforge.org'
@@ -50,7 +50,7 @@ spec = Gem::Specification.new do |spec|
50
50
  spec.extensions << 'ext/extconf.rb'
51
51
  spec.required_ruby_version = ">= 1.8.6"
52
52
  end
53
- spec.requirements << 'libdiscid (http://musicbrainz.org/doc/libdiscid)'
53
+ spec.requirements << 'libdiscid >= 0.2.2 (http://musicbrainz.org/doc/libdiscid)'
54
54
  spec.require_paths = ['lib', 'ext']
55
55
  spec.autorequire = spec.name
56
56
  spec.description = PKG_DESCRIPTION
data/examples/discid.rb CHANGED
@@ -9,7 +9,11 @@
9
9
  # Example:
10
10
  # ./discid.rb /dev/dvd
11
11
  #
12
- # $Id: discid.rb 201 2008-02-13 14:59:48Z phw $
12
+ # $Id: discid.rb 312 2010-06-14 21:04:14Z phw $
13
+
14
+ # Just make sure we can run this example from the command
15
+ # line even if RBrainz is not yet installed properly.
16
+ $: << 'lib/' << 'ext/' << '../ext/' << '../lib/'
13
17
 
14
18
  require 'mb-discid'
15
19
 
@@ -55,3 +59,4 @@ end
55
59
  # Print a submission URL that can be used to submit
56
60
  # the disc ID to MusicBrainz.org.
57
61
  puts "\nSubmit via #{disc.submission_url}"
62
+ puts "\nWebservice #{disc.webservice_url}"
data/ext/extconf.rb CHANGED
@@ -1,8 +1,54 @@
1
1
  #!/usr/bin/env ruby
2
- # $Id: extconf.rb 68 2007-06-03 14:12:21Z phw $
2
+ # $Id: extconf.rb 329 2011-07-02 12:49:58Z phw $
3
3
 
4
4
  require 'mkmf'
5
5
 
6
+ LIBDIR = Config::CONFIG['libdir']
7
+ INCLUDEDIR = Config::CONFIG['includedir']
8
+
9
+ $CFLAGS << " #{ENV["CFLAGS"]}"
10
+ $LIBS << " #{ENV["LIBS"]}"
11
+
12
+ # totally thieved from Nokogiri's extconf.rb
13
+ if Config::CONFIG['target_os'] =~ /mswin32/
14
+ # There's no default include/lib dir on Windows. Let's just add the Ruby ones
15
+ # and resort on the search path specified by INCLUDE and LIB environment
16
+ # variables
17
+ HEADER_DIRS = [INCLUDEDIR]
18
+ LIB_DIRS = [LIBDIR]
19
+
20
+ else
21
+ HEADER_DIRS = [
22
+ # First search /opt/local for macports
23
+ '/opt/local/include',
24
+
25
+ # Then search /usr/local for people that installed from source
26
+ '/usr/local/include',
27
+
28
+ # Check the ruby install locations
29
+ INCLUDEDIR,
30
+
31
+ # Finally fall back to /usr
32
+ '/usr/include',
33
+ ]
34
+
35
+ LIB_DIRS = [
36
+ # First search /opt/local for macports
37
+ '/opt/local/lib',
38
+
39
+ # Then search /usr/local for people that installed from source
40
+ '/usr/local/lib',
41
+
42
+ # Check the ruby install locations
43
+ LIBDIR,
44
+
45
+ # Finally fall back to /usr
46
+ '/usr/lib',
47
+ ]
48
+ end
49
+
50
+ dir_config('discid', HEADER_DIRS, LIB_DIRS)
51
+
6
52
  if have_library('discid', 'discid_new') or
7
53
  have_library('discid.dll', 'discid_new')
8
54
  # Remove -MD from compiler flags on Windows.
@@ -10,4 +56,4 @@ if have_library('discid', 'discid_new') or
10
56
  create_makefile('MB_DiscID')
11
57
  else
12
58
  puts 'Required library libdiscid not found.'
13
- end
59
+ end
data/ext/mb_discid.c CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * $Id: mb_discid.c 301 2009-11-19 11:39:31Z phw $
2
+ * $Id: mb_discid.c 312 2010-06-14 21:04:14Z phw $
3
3
  *
4
4
  * Ruby bindings for libdiscid. See http://musicbrainz.org/doc/libdiscid
5
5
  * for more information on libdiscid and MusicBrainz.
@@ -65,6 +65,30 @@ static VALUE mb_discid_submission_url(VALUE self)
65
65
  }
66
66
  }
67
67
 
68
+ /**
69
+ * call-seq:
70
+ * webservice_url() -> string or nil
71
+ *
72
+ * Return an URL for retrieving CD information from MusicBrainz' web service
73
+ *
74
+ * The URL provides the CD information in XML.
75
+ * See http://musicbrainz.org/development/mmd for details.
76
+ *
77
+ * Returns +nil+ if no ID was yet read.
78
+ */
79
+ static VALUE mb_discid_webservice_url(VALUE self)
80
+ {
81
+ if (rb_iv_get(self, "@read") == Qfalse)
82
+ return Qnil;
83
+ else
84
+ {
85
+ DiscId *disc;
86
+ Data_Get_Struct(self, DiscId, disc);
87
+
88
+ return rb_str_new2(discid_get_webservice_url(disc));
89
+ }
90
+ }
91
+
68
92
  /**
69
93
  * call-seq:
70
94
  * freedb_id() -> string or nil
@@ -352,6 +376,7 @@ void Init_MB_DiscID()
352
376
  rb_define_method(cDiscID, "put", mb_discid_put, 3);
353
377
  rb_define_method(cDiscID, "id", mb_discid_id, 0);
354
378
  rb_define_method(cDiscID, "submission_url", mb_discid_submission_url, 0);
379
+ rb_define_method(cDiscID, "webservice_url", mb_discid_webservice_url, 0);
355
380
  rb_define_method(cDiscID, "freedb_id", mb_discid_freedb_id, 0);
356
381
  rb_define_method(cDiscID, "first_track_num", mb_discid_first_track_num, 0);
357
382
  rb_define_method(cDiscID, "last_track_num", mb_discid_last_track_num, 0);
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mb-discid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ hash: 17
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 5
10
+ version: 0.1.5
5
11
  platform: ruby
6
12
  authors:
7
13
  - Philipp Wolfer
@@ -9,7 +15,7 @@ autorequire: mb-discid
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-11-19 00:00:00 +01:00
18
+ date: 2011-07-02 00:00:00 +02:00
13
19
  default_executable:
14
20
  dependencies: []
15
21
 
@@ -44,21 +50,29 @@ require_paths:
44
50
  - lib
45
51
  - ext
46
52
  required_ruby_version: !ruby/object:Gem::Requirement
53
+ none: false
47
54
  requirements:
48
55
  - - ">="
49
56
  - !ruby/object:Gem::Version
57
+ hash: 59
58
+ segments:
59
+ - 1
60
+ - 8
61
+ - 6
50
62
  version: 1.8.6
51
- version:
52
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
+ none: false
53
65
  requirements:
54
66
  - - ">="
55
67
  - !ruby/object:Gem::Version
68
+ hash: 3
69
+ segments:
70
+ - 0
56
71
  version: "0"
57
- version:
58
72
  requirements:
59
- - libdiscid (http://musicbrainz.org/doc/libdiscid)
73
+ - libdiscid >= 0.2.2 (http://musicbrainz.org/doc/libdiscid)
60
74
  rubyforge_project: rbrainz
61
- rubygems_version: 1.3.5
75
+ rubygems_version: 1.3.7
62
76
  signing_key:
63
77
  specification_version: 3
64
78
  summary: Ruby bindings for libdiscid.