libarchive-ruby-swig 0.5.2 → 0.5.3

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 (3) hide show
  1. data/lib/libarchive_doc.rb +18 -18
  2. data/lib/libarchive_rs.rb +24 -7
  3. metadata +4 -4
@@ -88,7 +88,7 @@ module Archive
88
88
  # Use one of the <code>Archive::ENTRY_*</code> to specify the filetype of
89
89
  # the Entry.
90
90
  #
91
- def filetype=(filetype)
91
+ def set_filetype(filetype)
92
92
  end
93
93
 
94
94
  ##
@@ -107,7 +107,7 @@ module Archive
107
107
  # field will not be availabla in most cases and is, in any case,
108
108
  # platform-specific.
109
109
  #
110
- def devmajor=(devmajor)
110
+ def set_devmajor(devmajor)
111
111
  end
112
112
 
113
113
  ##
@@ -126,7 +126,7 @@ module Archive
126
126
  # field will not be availabla in most cases and is, in any case,
127
127
  # platform-specific.
128
128
  #
129
- def devminor=(devminor)
129
+ def set_devminor(devminor)
130
130
  end
131
131
 
132
132
  ##
@@ -169,7 +169,7 @@ module Archive
169
169
  # Sets the device id of the device on which entry resided. This is usually
170
170
  # unused and, in any case, platform-specific.
171
171
  #
172
- def dev=(dev)
172
+ def set_dev(dev)
173
173
  end
174
174
 
175
175
  ##
@@ -183,7 +183,7 @@ module Archive
183
183
  #
184
184
  # Sets the group id of the Entry.
185
185
  #
186
- def gid=(gid)
186
+ def set_gid(gid)
187
187
  end
188
188
 
189
189
  ##
@@ -197,7 +197,7 @@ module Archive
197
197
  #
198
198
  # Sets the group name of the Entry.
199
199
  #
200
- def gname=(gname)
200
+ def set_gname(gname)
201
201
  end
202
202
 
203
203
  ##
@@ -211,7 +211,7 @@ module Archive
211
211
  #
212
212
  # Sets the path to the file this entry is hard-linked to.
213
213
  #
214
- def hardlink=
214
+ def set_hardlink(path)
215
215
  end
216
216
 
217
217
  ##
@@ -225,7 +225,7 @@ module Archive
225
225
  #
226
226
  # Sets the inode of Entry.
227
227
  #
228
- def ino=(ino)
228
+ def set_ino(ino)
229
229
  end
230
230
 
231
231
  ##
@@ -239,7 +239,7 @@ module Archive
239
239
  #
240
240
  # Sets the permission bits (and/or filetype) of Entry.
241
241
  #
242
- def mode=(mode)
242
+ def set_mode(mode)
243
243
  end
244
244
 
245
245
  ##
@@ -253,7 +253,7 @@ module Archive
253
253
  #
254
254
  # Sets the mtime of the saved Entry from a timestamp.
255
255
  #
256
- def mtime=(mtime)
256
+ def set_mtime(mtime)
257
257
  end
258
258
 
259
259
  ##
@@ -267,7 +267,7 @@ module Archive
267
267
  #
268
268
  # Sets the number of hard links to this Entry.
269
269
  #
270
- def nlink=(num_links)
270
+ def set_nlink(num_links)
271
271
  end
272
272
 
273
273
  ##
@@ -281,7 +281,7 @@ module Archive
281
281
  #
282
282
  # Sets the pathname of this Entry.
283
283
  #
284
- def pathname=(pathname)
284
+ def set_pathname(pathname)
285
285
  end
286
286
 
287
287
  ##
@@ -295,7 +295,7 @@ module Archive
295
295
  #
296
296
  # Sets the dev major number of the device this Entry represents.
297
297
  #
298
- def rdevmajor=(devmajor)
298
+ def set_rdevmajor(devmajor)
299
299
  end
300
300
 
301
301
  ##
@@ -309,7 +309,7 @@ module Archive
309
309
  #
310
310
  # Sets the dev minor number of the device this Entry represents.
311
311
  #
312
- def rdevminor=(devminor)
312
+ def set_rdevminor(devminor)
313
313
  end
314
314
 
315
315
  ##
@@ -325,7 +325,7 @@ module Archive
325
325
  # Sets the size of the Entry. In case Entry is a symlink, this should
326
326
  # be the length of the string set with <code>symlink=</code>.
327
327
  #
328
- def size=()
328
+ def set_size()
329
329
  end
330
330
 
331
331
  ##
@@ -339,7 +339,7 @@ module Archive
339
339
  #
340
340
  # Sets the target of a symlink Entry.
341
341
  #
342
- def symlink=(symlink)
342
+ def set_symlink(path)
343
343
  end
344
344
 
345
345
  ##
@@ -353,7 +353,7 @@ module Archive
353
353
  #
354
354
  # Sets the user id of this Entry.
355
355
  #
356
- def uid=(uid)
356
+ def set_uid(uid)
357
357
  end
358
358
 
359
359
  ##
@@ -367,7 +367,7 @@ module Archive
367
367
  #
368
368
  # Sets the owner name of this Entry.
369
369
  #
370
- def uname=(uname)
370
+ def set_uname(uname)
371
371
  end
372
372
 
373
373
  private
data/lib/libarchive_rs.rb CHANGED
@@ -68,15 +68,32 @@ module Archive
68
68
  #
69
69
  # Reads size bytes from the Archive. If a block is given, chunks of size
70
70
  # bytes are repeatedly passed to the block until the complete data stored
71
- # for the Entry has been read.
71
+ # for the Entry has been read. If size is not specified, all data stored
72
+ # is returned at once.
72
73
  #
73
- def read_data(size)
74
+ def read_data(size = nil)
74
75
  if block_given?
75
- while result = self.read_data_helper(size)
76
- yield result
76
+ if size.nil?
77
+ result = []
78
+ while data = self.read_data_helper(1024)
79
+ result << data
80
+ end
81
+ yield result.join('')
82
+ else
83
+ while data = self.read_data_helper(size)
84
+ yield data
85
+ end
77
86
  end
78
87
  else
79
- return self.read_data_helper(size)
88
+ if size.nil?
89
+ result = []
90
+ while data = self.read_data_helper(1024)
91
+ result << data
92
+ end
93
+ return result.join('')
94
+ else
95
+ return self.read_data_helper(size)
96
+ end
80
97
  end
81
98
  end
82
99
 
@@ -107,8 +124,8 @@ module Archive
107
124
  #
108
125
  def write_data(data = nil)
109
126
  if block_given?
110
- while result = yield
111
- self.write_data_helper(result)
127
+ while data = yield
128
+ self.write_data_helper(data)
112
129
  end
113
130
  else
114
131
  self.write_data_helper(data)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libarchive-ruby-swig
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 2
10
- version: 0.5.2
9
+ - 3
10
+ version: 0.5.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Koch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-12 00:00:00 +02:00
18
+ date: 2011-02-16 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21