zipruby 0.3.2-mswin32 → 0.3.3-mswin32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of zipruby might be problematic. Click here for more details.

data/ChangeLog CHANGED
@@ -1,3 +1,11 @@
1
+ 2010-01-23 winebarrel
2
+
3
+ * fixes bug: [ruby-dev:40120] SEGV on zipruby with irb
4
+
5
+ 2009-06-11 winebarrel
6
+
7
+ * fixes bug: C macro mistake (reported by SHITAMORI Akira)
8
+
1
9
  2009-05-16 winebarrel
2
10
 
3
11
  * improve Zip::Archive#add_io, replace_io, add, replace
data/README.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  = Zip/Ruby
2
2
 
3
- Copyright (c) 2008 SUGAWARA Genki <sgwr_dts@yahoo.co.jp>
3
+ Copyright (c) 2008-2010 SUGAWARA Genki <sgwr_dts@yahoo.co.jp>
4
4
 
5
5
  == Description
6
6
 
@@ -86,6 +86,7 @@ https://rubyforge.org/frs/?group_id=6124
86
86
 
87
87
  # include directory in zip archive
88
88
  Zip::Archive.open('filename.zip') do |ar|
89
+ ar.add_dir('dirname')
89
90
  ar.add_file('dirname/foo.txt', 'foo.txt')
90
91
  # args: <entry name> , <source>
91
92
 
Binary file
data/zipruby.c CHANGED
@@ -312,6 +312,7 @@ static VALUE zipruby_archive_alloc(VALUE klass) {
312
312
  p->flags = 0;
313
313
  p->tmpfilnam = NULL;
314
314
  p->buffer = Qnil;
315
+ p->sources = Qnil;
315
316
 
316
317
  return Data_Wrap_Struct(klass, zipruby_archive_mark, zipruby_archive_free, p);
317
318
  }
@@ -319,6 +320,7 @@ static VALUE zipruby_archive_alloc(VALUE klass) {
319
320
  static void zipruby_archive_mark(struct zipruby_archive *p) {
320
321
  rb_gc_mark(p->path);
321
322
  rb_gc_mark(p->buffer);
323
+ rb_gc_mark(p->sources);
322
324
  }
323
325
 
324
326
  static void zipruby_archive_free(struct zipruby_archive *p) {
@@ -356,6 +358,7 @@ static VALUE zipruby_archive_s_open(int argc, VALUE *argv, VALUE self) {
356
358
 
357
359
  p_archive->path = path;
358
360
  p_archive->flags = i_flags;
361
+ p_archive->sources = rb_ary_new();
359
362
 
360
363
  if (rb_block_given_p()) {
361
364
  VALUE retval;
@@ -426,6 +429,7 @@ static VALUE zipruby_archive_s_open_buffer(int argc, VALUE *argv, VALUE self) {
426
429
  p_archive->path = rb_str_new2(p_archive->tmpfilnam);
427
430
  p_archive->flags = i_flags;
428
431
  p_archive->buffer = buffer;
432
+ p_archive->sources = rb_ary_new();
429
433
 
430
434
  if (rb_block_given_p()) {
431
435
  VALUE retval;
@@ -877,6 +881,7 @@ static VALUE zipruby_archive_add_io(int argc, VALUE *argv, VALUE self) {
877
881
  }
878
882
 
879
883
  z->io = file;
884
+ rb_ary_push(p_archive->sources, file);
880
885
  z->mtime = TIME2LONG(mtime);
881
886
 
882
887
  if ((zsource = zip_source_io(p_archive->archive, z)) == NULL) {
@@ -939,6 +944,7 @@ static VALUE zipruby_archive_replace_io(int argc, VALUE *argv, VALUE self) {
939
944
  }
940
945
 
941
946
  z->io = file;
947
+ rb_ary_push(p_archive->sources, file);
942
948
  z->mtime = TIME2LONG(mtime);
943
949
 
944
950
  if ((zsource = zip_source_io(p_archive->archive, z)) == NULL) {
@@ -1011,6 +1017,7 @@ static VALUE zipruby_archive_add_function(int argc, VALUE *argv, VALUE self) {
1011
1017
  }
1012
1018
 
1013
1019
  z->proc = rb_block_proc();
1020
+ rb_ary_push(p_archive->sources, z->proc);
1014
1021
  z->mtime = TIME2LONG(mtime);
1015
1022
 
1016
1023
  if ((zsource = zip_source_proc(p_archive->archive, z)) == NULL) {
@@ -1069,6 +1076,7 @@ static VALUE zipruby_archive_replace_function(int argc, VALUE *argv, VALUE self)
1069
1076
  }
1070
1077
 
1071
1078
  z->proc = rb_block_proc();
1079
+ rb_ary_push(p_archive->sources, z->proc);
1072
1080
  z->mtime = TIME2LONG(mtime);
1073
1081
 
1074
1082
  if ((zsource = zip_source_proc(p_archive->archive, z)) == NULL) {
@@ -2420,8 +2428,9 @@ static ssize_t read_proc(void *state, void *data, size_t len, enum zip_source_cm
2420
2428
  return -1;
2421
2429
  }
2422
2430
 
2431
+
2423
2432
  if (TYPE(src) != T_STRING) {
2424
- return 0;
2433
+ src = rb_funcall(src, rb_intern("to_s"), 0);
2425
2434
  }
2426
2435
 
2427
2436
  n = RSTRING_LEN(src);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zipruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: mswin32
6
6
  authors:
7
7
  - winebarrel
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-12 00:00:00 +09:00
12
+ date: 2010-01-23 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -32,6 +32,8 @@ files:
32
32
  - ChangeLog
33
33
  has_rdoc: true
34
34
  homepage: http://zipruby.rubyforge.org
35
+ licenses: []
36
+
35
37
  post_install_message:
36
38
  rdoc_options:
37
39
  - --title
@@ -53,9 +55,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
55
  requirements: []
54
56
 
55
57
  rubyforge_project: zipruby
56
- rubygems_version: 1.3.1
58
+ rubygems_version: 1.3.5
57
59
  signing_key:
58
- specification_version: 2
60
+ specification_version: 3
59
61
  summary: Ruby bindings for libzip.
60
62
  test_files: []
61
63