ffi-libarchive 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.1.3 / 2011-04-20
2
+ * Always use 'bytesize' instead of 'size' for determining raw memory size
3
+
1
4
  == 0.1.2 / 2011-04-12
2
5
  * Writer::add_entry sets content size
3
6
  * Modify usage of callbacks and FFI::Buffer to work with rubinius
@@ -46,9 +46,9 @@ module Archive
46
46
  raise Error, @archive if C::archive_read_open_filename(archive, params[:file_name], 1024) != C::OK
47
47
  elsif params[:memory]
48
48
  str = params[:memory]
49
- @data = FFI::MemoryPointer.new(str.size + 1)
50
- @data.write_string str, str.size
51
- raise Error, @archive if C::archive_read_open_memory(archive, @data, str.size) != C::OK
49
+ @data = FFI::MemoryPointer.new(str.bytesize + 1)
50
+ @data.write_string str, str.bytesize
51
+ raise Error, @archive if C::archive_read_open_memory(archive, @data, str.bytesize) != C::OK
52
52
  end
53
53
  rescue
54
54
  close
@@ -100,7 +100,7 @@ module Archive
100
100
  entry = Entry.new
101
101
  data = yield entry
102
102
  if data
103
- entry.size = data.size
103
+ entry.size = data.bytesize
104
104
  write_header entry
105
105
  write_data data
106
106
  else
@@ -119,7 +119,7 @@ module Archive
119
119
  len = 0
120
120
  while true do
121
121
  str = yield
122
- if ((n = C::archive_write_data(ar, str, str.size)) < 1)
122
+ if ((n = C::archive_write_data(ar, str, str.bytesize)) < 1)
123
123
  return len
124
124
  end
125
125
  len += n
@@ -127,7 +127,7 @@ module Archive
127
127
  else
128
128
  raise ArgumentError, "wrong number of argument (#{args.size}) for 1)" if args.size != 1
129
129
  str = args[0]
130
- C::archive_write_data(archive, str, str.size)
130
+ C::archive_write_data(archive, str, str.bytesize)
131
131
  end
132
132
  end
133
133
 
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ffi-libarchive
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Frank Fischer
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-12 00:00:00 Z
13
+ date: 2011-04-20 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ffi