rbcdio 0.01 → 0.02

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cdio.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # $Id: cdio.rb,v 1.18 2006/12/16 13:24:48 rocky Exp $
2
+ # $Id: cdio.rb,v 1.19 2007/10/13 23:00:18 rocky Exp $
3
3
  #
4
4
  # Copyright (C) 2006 Rocky Bernstein <rocky@gnu.org>
5
5
  #
@@ -119,18 +119,18 @@ class TrackError < DeviceException; end
119
119
  # cdio_get_driver_name().
120
120
  def drivers()
121
121
  return {
122
- :"Unknown" => Rubycdio::DRIVER_UNKNOWN,
123
- :"AIX" => Rubycdio::DRIVER_AIX,
124
- :"BSDI" => Rubycdio::DRIVER_BSDI,
125
- :"FreeBSD" => Rubycdio::DRIVER_FREEBSD,
122
+ :Unknown => Rubycdio::DRIVER_UNKNOWN,
123
+ :AIX => Rubycdio::DRIVER_AIX,
124
+ :BSDI => Rubycdio::DRIVER_BSDI,
125
+ :FreeBSD => Rubycdio::DRIVER_FREEBSD,
126
126
  :"GNU/Linux" => Rubycdio::DRIVER_LINUX,
127
- :"Solaris" => Rubycdio::DRIVER_SOLARIS,
127
+ :Solaris => Rubycdio::DRIVER_SOLARIS,
128
128
  :"OS X" => Rubycdio::DRIVER_OSX,
129
- :"WIN32" => Rubycdio::DRIVER_WIN32,
130
- :"CDRDAO" => Rubycdio::DRIVER_CDRDAO,
129
+ :WIN32 => Rubycdio::DRIVER_WIN32,
130
+ :CDRDAO => Rubycdio::DRIVER_CDRDAO,
131
131
  :"BIN/CUE" => Rubycdio::DRIVER_BINCUE,
132
- :"NRG" => Rubycdio::DRIVER_NRG,
133
- :"device" => Rubycdio::DRIVER_DEVICE
132
+ :NRG => Rubycdio::DRIVER_NRG,
133
+ :device => Rubycdio::DRIVER_DEVICE
134
134
  }
135
135
  end
136
136
 
data/lib/iso9660.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # $Id: iso9660.rb,v 1.11 2006/12/16 13:24:48 rocky Exp $
2
+ # $Id: iso9660.rb,v 1.12 2007/10/13 23:00:18 rocky Exp $
3
3
  #
4
4
  # Copyright (C) 2006 Rocky Bernstein <rocky@gnu.org>
5
5
  #
@@ -440,10 +440,10 @@ end # class ISO9660
440
440
 
441
441
  def ISO9660.check_types()
442
442
  return {
443
- :"nocheck" => Rubyiso9660::NOCHECK,
444
- :"7bit" => Rubyiso9660::SEVEN_BIT,
445
- :"achars" => Rubyiso9660::ACHARS,
446
- :"dchars" => Rubyiso9660::DCHARS
443
+ :nocheck => Rubyiso9660::NOCHECK,
444
+ :"7bit" => Rubyiso9660::SEVEN_BIT,
445
+ :achars => Rubyiso9660::ACHARS,
446
+ :dchars => Rubyiso9660::DCHARS
447
447
  }
448
448
  end
449
449
 
data/missing CHANGED
@@ -1,9 +1,9 @@
1
1
  #! /bin/sh
2
2
  # Common stub for a few missing GNU programs while installing.
3
3
 
4
- scriptversion=2005-06-08.21
4
+ scriptversion=2006-05-10.23
5
5
 
6
- # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
6
+ # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
7
7
  # Free Software Foundation, Inc.
8
8
  # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
9
9
 
@@ -33,6 +33,8 @@ if test $# -eq 0; then
33
33
  fi
34
34
 
35
35
  run=:
36
+ sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
37
+ sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
36
38
 
37
39
  # In the cases where this matters, `missing' is being run in the
38
40
  # srcdir already.
@@ -44,7 +46,7 @@ fi
44
46
 
45
47
  msg="missing on your system"
46
48
 
47
- case "$1" in
49
+ case $1 in
48
50
  --run)
49
51
  # Try to run requested program, and just exit if it succeeds.
50
52
  run=
@@ -77,6 +79,7 @@ Supported PROGRAM values:
77
79
  aclocal touch file \`aclocal.m4'
78
80
  autoconf touch file \`configure'
79
81
  autoheader touch file \`config.h.in'
82
+ autom4te touch the output file, or create a stub one
80
83
  automake touch all \`Makefile.in' files
81
84
  bison create \`y.tab.[ch]', if possible, from existing .[ch]
82
85
  flex create \`lex.yy.c', if possible, from existing .c
@@ -106,7 +109,7 @@ esac
106
109
  # Now exit if we have it, but it failed. Also exit now if we
107
110
  # don't have it and --version was passed (most likely to detect
108
111
  # the program).
109
- case "$1" in
112
+ case $1 in
110
113
  lex|yacc)
111
114
  # Not GNU programs, they don't have --version.
112
115
  ;;
@@ -135,7 +138,7 @@ esac
135
138
 
136
139
  # If it does not exist, or fails to run (possibly an outdated version),
137
140
  # try to emulate it.
138
- case "$1" in
141
+ case $1 in
139
142
  aclocal*)
140
143
  echo 1>&2 "\
141
144
  WARNING: \`$1' is $msg. You should only need it if
@@ -164,7 +167,7 @@ WARNING: \`$1' is $msg. You should only need it if
164
167
  test -z "$files" && files="config.h"
165
168
  touch_files=
166
169
  for f in $files; do
167
- case "$f" in
170
+ case $f in
168
171
  *:*) touch_files="$touch_files "`echo "$f" |
169
172
  sed -e 's/^[^:]*://' -e 's/:.*//'`;;
170
173
  *) touch_files="$touch_files $f.in";;
@@ -192,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg.
192
195
  You can get \`$1' as part of \`Autoconf' from any GNU
193
196
  archive site."
194
197
 
195
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
196
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
198
+ file=`echo "$*" | sed -n "$sed_output"`
199
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
197
200
  if test -f "$file"; then
198
201
  touch $file
199
202
  else
@@ -214,25 +217,25 @@ WARNING: \`$1' $msg. You should only need it if
214
217
  in order for those modifications to take effect. You can get
215
218
  \`Bison' from any GNU archive site."
216
219
  rm -f y.tab.c y.tab.h
217
- if [ $# -ne 1 ]; then
220
+ if test $# -ne 1; then
218
221
  eval LASTARG="\${$#}"
219
- case "$LASTARG" in
222
+ case $LASTARG in
220
223
  *.y)
221
224
  SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
222
- if [ -f "$SRCFILE" ]; then
225
+ if test -f "$SRCFILE"; then
223
226
  cp "$SRCFILE" y.tab.c
224
227
  fi
225
228
  SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
226
- if [ -f "$SRCFILE" ]; then
229
+ if test -f "$SRCFILE"; then
227
230
  cp "$SRCFILE" y.tab.h
228
231
  fi
229
232
  ;;
230
233
  esac
231
234
  fi
232
- if [ ! -f y.tab.h ]; then
235
+ if test ! -f y.tab.h; then
233
236
  echo >y.tab.h
234
237
  fi
235
- if [ ! -f y.tab.c ]; then
238
+ if test ! -f y.tab.c; then
236
239
  echo 'main() { return 0; }' >y.tab.c
237
240
  fi
238
241
  ;;
@@ -244,18 +247,18 @@ WARNING: \`$1' is $msg. You should only need it if
244
247
  in order for those modifications to take effect. You can get
245
248
  \`Flex' from any GNU archive site."
246
249
  rm -f lex.yy.c
247
- if [ $# -ne 1 ]; then
250
+ if test $# -ne 1; then
248
251
  eval LASTARG="\${$#}"
249
- case "$LASTARG" in
252
+ case $LASTARG in
250
253
  *.l)
251
254
  SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
252
- if [ -f "$SRCFILE" ]; then
255
+ if test -f "$SRCFILE"; then
253
256
  cp "$SRCFILE" lex.yy.c
254
257
  fi
255
258
  ;;
256
259
  esac
257
260
  fi
258
- if [ ! -f lex.yy.c ]; then
261
+ if test ! -f lex.yy.c; then
259
262
  echo 'main() { return 0; }' >lex.yy.c
260
263
  fi
261
264
  ;;
@@ -267,11 +270,9 @@ WARNING: \`$1' is $msg. You should only need it if
267
270
  \`Help2man' package in order for those modifications to take
268
271
  effect. You can get \`Help2man' from any GNU archive site."
269
272
 
270
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
271
- if test -z "$file"; then
272
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
273
- fi
274
- if [ -f "$file" ]; then
273
+ file=`echo "$*" | sed -n "$sed_output"`
274
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
275
+ if test -f "$file"; then
275
276
  touch $file
276
277
  else
277
278
  test -z "$file" || exec >$file
@@ -289,11 +290,17 @@ WARNING: \`$1' is $msg. You should only need it if
289
290
  DU, IRIX). You might want to install the \`Texinfo' package or
290
291
  the \`GNU make' package. Grab either from any GNU archive site."
291
292
  # The file to touch is that specified with -o ...
292
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
293
+ file=`echo "$*" | sed -n "$sed_output"`
294
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
293
295
  if test -z "$file"; then
294
296
  # ... or it is the one specified with @setfilename ...
295
297
  infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
296
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
298
+ file=`sed -n '
299
+ /^@setfilename/{
300
+ s/.* \([^ ]*\) *$/\1/
301
+ p
302
+ q
303
+ }' $infile`
297
304
  # ... or it is derived from the source name (dir/f.texi becomes f.info)
298
305
  test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
299
306
  fi
@@ -317,13 +324,13 @@ WARNING: \`$1' is $msg. You should only need it if
317
324
  fi
318
325
  firstarg="$1"
319
326
  if shift; then
320
- case "$firstarg" in
327
+ case $firstarg in
321
328
  *o*)
322
329
  firstarg=`echo "$firstarg" | sed s/o//`
323
330
  tar "$firstarg" "$@" && exit 0
324
331
  ;;
325
332
  esac
326
- case "$firstarg" in
333
+ case $firstarg in
327
334
  *h*)
328
335
  firstarg=`echo "$firstarg" | sed s/h//`
329
336
  tar "$firstarg" "$@" && exit 0
data/swig/device.swg CHANGED
@@ -1,7 +1,7 @@
1
1
  /* -*- c -*-
2
- $Id: device.swg,v 1.10 2006/12/08 13:42:20 rocky Exp $
2
+ $Id: device.swg,v 1.11 2007/10/14 10:22:28 rocky Exp $
3
3
 
4
- Copyright (C) 2006 Rocky Bernstein <rocky@gnu.org>
4
+ Copyright (C) 2006, 2007 Rocky Bernstein <rocky@gnu.org>
5
5
 
6
6
  This program is free software; you can redistribute it and/or modify
7
7
  it under the terms of the GNU General Public License as published by
data/swig/rubycdio.swg CHANGED
@@ -1,7 +1,7 @@
1
1
  /* -*- c -*-
2
- $Id: rubycdio.swg,v 1.2 2006/11/13 21:44:31 rocky Exp $
2
+ $Id: rubycdio.swg,v 1.3 2007/10/14 10:22:28 rocky Exp $
3
3
 
4
- Copyright (C) 2006 Rocky Bernstein <rocky@panix.com>
4
+ Copyright (C) 2006, 2007 Rocky Bernstein <rocky@gnu.org>
5
5
 
6
6
  This program is free software; you can redistribute it and/or modify
7
7
  it under the terms of the GNU General Public License as published by
data/swig/rubyiso9660.swg CHANGED
@@ -1,5 +1,5 @@
1
1
  /* -*- c -*-
2
- $Id: rubyiso9660.swg,v 1.4 2006/11/29 10:29:00 rocky Exp $
2
+ $Id: rubyiso9660.swg,v 1.5 2007/08/01 04:06:39 rocky Exp $
3
3
 
4
4
  Copyright (C) 2006 Rocky Bernstein <rocky@gnu.org>
5
5
 
@@ -434,7 +434,7 @@ char * name_translate(const char *psz_oldname);
434
434
  %inline %{
435
435
  char *
436
436
  name_translate(const char *psz_oldname) {
437
- char *psz_newname=calloc(sizeof(char), strlen(psz_oldname));
437
+ char *psz_newname=calloc(sizeof(char), strlen(psz_oldname)+1);
438
438
  iso9660_name_translate(psz_oldname, psz_newname);
439
439
  return psz_newname;
440
440
  }
@@ -458,7 +458,7 @@ char * name_translate_ext(const char *psz_oldname, uint8_t i_joliet_level);
458
458
  %inline %{
459
459
  char *
460
460
  name_translate_ext(const char *psz_oldname, uint8_t i_joliet_level) {
461
- char *psz_newname=calloc(sizeof(char), strlen(psz_oldname));
461
+ char *psz_newname=calloc(sizeof(char), strlen(psz_oldname)+1);
462
462
  iso9660_name_translate_ext(psz_oldname, psz_newname, i_joliet_level);
463
463
  return psz_newname;
464
464
  }
data/test/cdiotest.rb CHANGED
@@ -1,17 +1,22 @@
1
1
  #!/usr/bin/env ruby
2
- # $Id: cdiotest.rb,v 1.13 2006/12/16 03:44:48 rocky Exp $
2
+ # $Id: cdiotest.rb,v 1.14 2007/10/13 09:23:17 rocky Exp $
3
3
 
4
4
  # Unit test for cdio
5
5
  #
6
6
  require "test/unit"
7
7
 
8
- Mypath = File.expand_path(File.dirname(__FILE__))
8
+ unless defined?(Mypath)
9
+ Mypath = File.expand_path(File.dirname(__FILE__))
10
+ end
9
11
  old_dir = File.expand_path(Dir.pwd)
10
12
  if old_dir != Mypath
11
13
  Dir.chdir(Mypath)
12
14
  end
13
- $: << Mypath + '/../ext/cdio'
14
- $: << Mypath + '/../lib'
15
+
16
+ %w(/../ext/cdio /../lib).each do |src_dir|
17
+ $: << Mypath + src_dir unless $:.member?(src_dir)
18
+ end
19
+
15
20
  require "cdio"
16
21
 
17
22
  class CdioTests < Test::Unit::TestCase
data/test/isotest.rb CHANGED
@@ -1,12 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
- # $Id: isotest.rb,v 1.7 2006/12/14 12:55:02 rocky Exp $
2
+ # $Id: isotest.rb,v 1.8 2007/10/13 09:23:17 rocky Exp $
3
3
  # Unit test for iso9660
4
4
 
5
5
  # Test some low-level ISO9660 routines
6
6
  # This is basically the same thing as libcdio's testiso9660.c
7
7
 
8
8
  require "test/unit"
9
- Mypath = File.expand_path(File.dirname(__FILE__))
9
+ unless defined?(Mypath)
10
+ Mypath = File.expand_path(File.dirname(__FILE__))
11
+ end
10
12
  $: << Mypath + '/../lib'
11
13
  $: << Mypath + '/../ext/cdio'
12
14
  $: << Mypath + '/../ext/iso9660'
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: rbcdio
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.01"
7
- date: 2006-12-21 19:32:52 -05:00
6
+ version: "0.02"
7
+ date: 2007-10-27 07:20:57 -04:00
8
8
  summary: Ruby to libcdio (CD Input and Control library)
9
9
  require_paths:
10
10
  - lib
@@ -25,6 +25,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
25
  platform: ruby
26
26
  signing_key:
27
27
  cert_chain:
28
+ post_install_message:
28
29
  authors:
29
30
  - Rocky Bernstein
30
31
  files:
@@ -62,6 +63,7 @@ files:
62
63
  - example/README
63
64
  - example/cd-read.rb
64
65
  - example/drivers.rb
66
+ - example/cdchange.rb
65
67
  - example/eject.rb
66
68
  - example/COPYING
67
69
  - example/tracks.rb