hdf5 0.3.4 → 0.3.5

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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/hdf5.gemspec +2 -2
  4. data/lib/hdf5.rb +8 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2befee7acbf6e2e264a2d69b952b05f76f96d0ce
4
- data.tar.gz: 87178ddd83a7643fc28581c4b59a1bc4ee4e1523
3
+ metadata.gz: ab73d6d8bc8df4d84509a2030fef544f7b830b1e
4
+ data.tar.gz: 856dd962ff750e37993eb266e319440247b55599
5
5
  SHA512:
6
- metadata.gz: 06d14090eb43ee3ebc37007968261cfb6590f11a33685251fc0710dfa9e94257791952490b03f092cab6b04e514ba2dd598b8dd0124f464ac90968745dbc2328
7
- data.tar.gz: 0e49116c3d162a22617fddc323592e247a27527b174291e4ce9db82f26bb1b8f7743100aada9adfb7f06e8eda00b012aaae72625de56500e1502414e72ae47f9
6
+ metadata.gz: f9970a09552f30d7b34ee92c754e85eef32c64fa56639dc0d8ba7cf4e288b0eb022109948ac02630db1fa58d375ce21e7ad4f2c5b57b2a387d93954dc8442eae
7
+ data.tar.gz: 3bf5b47e5cbcb3860b6e6f6f726d94b965a6c44bdfe4a1dd6b2b792f42bf7e8e256faff663bd3869ac3b21823e1766530e92e10719745c270e0055b9bda86d7e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.4
1
+ 0.3.5
@@ -2,12 +2,12 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: hdf5 0.3.4 ruby lib
5
+ # stub: hdf5 0.3.5 ruby lib
6
6
  # stub: ext/hdf5/extconf.rb
7
7
 
8
8
  Gem::Specification.new do |s|
9
9
  s.name = "hdf5"
10
- s.version = "0.3.4"
10
+ s.version = "0.3.5"
11
11
 
12
12
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
13
13
  s.require_paths = ["lib"]
@@ -148,6 +148,7 @@ module Hdf5
148
148
  extend FFI::Library
149
149
  ffi_lib H5Library.library_path
150
150
  attach_function :basic_open, :H5Dopen2, [H5Types.hid_t, :string, H5Types.hid_t], H5Types.hid_t
151
+ attach_function :basic_close, :H5Dclose, [H5Types.hid_t], H5Types.herr_t
151
152
  attach_function :basic_get_type, :H5Dget_type, [H5Types.hid_t], H5Types.hid_t
152
153
  attach_function :basic_get_space, :H5Dget_space, [H5Types.hid_t], H5Types.hid_t
153
154
  attach_function :basic_read, :H5Dread, [H5Types.hid_t, H5Types.hid_t, H5Types.hid_t, H5Types.hid_t, H5Types.hid_t, :pointer], H5Types.herr_t
@@ -157,11 +158,13 @@ module Hdf5
157
158
  def self.open(location_id, name)
158
159
  id = basic_open(location_id, name, 0)
159
160
  raise NotFound.new("dataset #{name} not found") if id < 0
160
- return new(id)
161
+ ds = new(id)
162
+ ds
161
163
  end
162
164
  # Create a new object. id is the id of the HDF5 dataset this wraps.
163
165
  # Use H5Dataset.open to open a dataset
164
166
  def initialize(id)
167
+ ObjectSpace.define_finalizer(self){H5Dataset.basic_close(id)}
165
168
  @id = id
166
169
  end
167
170
  # Return an H5Datatype object containing information about the type
@@ -242,6 +245,7 @@ module Hdf5
242
245
  attr_reader :id
243
246
  extend FFI::Library
244
247
  ffi_lib H5Library.library_path
248
+ attach_function :basic_close, :H5Sclose, [H5Types.hid_t], H5Types.herr_t
245
249
  attach_function :basic_get_simple_extent_ndims, :H5Sget_simple_extent_ndims, [H5Types.hid_t], :int
246
250
  attach_function :basic_get_simple_extent_dims, :H5Sget_simple_extent_dims, [H5Types.hid_t, :pointer, :pointer], :int
247
251
  attach_function :basic_create_simple, :H5Screate_simple, [:int, :pointer, :pointer], H5Types.hid_t
@@ -263,6 +267,7 @@ module Hdf5
263
267
  # Create a new H5Dataspace object. id must be the id
264
268
  # of a pre-existing HDF5 dataspace.
265
269
  def initialize(id)
270
+ ObjectSpace.define_finalizer(self){H5Dataspace.basic_close(id)}
266
271
  @id = id
267
272
  end
268
273
  # Number of dimensions in the dataspace
@@ -298,11 +303,13 @@ module Hdf5
298
303
  class H5Datatype
299
304
  extend FFI::Library
300
305
  ffi_lib H5Library.library_path
306
+ attach_function :basic_close, :H5Tclose, [H5Types.hid_t], H5Types.herr_t
301
307
  attach_function :basic_get_class, :H5Tget_class, [H5Types.hid_t], H5Types.h5t_class_t
302
308
  attach_function :basic_get_nmembers, :H5Tget_nmembers, [H5Types.hid_t], :int
303
309
  attach_function :basic_get_member_type, :H5Tget_member_type, [H5Types.hid_t, :uint], H5Types.hid_t
304
310
  attr_reader :id
305
311
  def initialize(id)
312
+ ObjectSpace.define_finalizer(self){H5Datatype.basic_close(id)}
306
313
  @id = id
307
314
  end
308
315
  def h5_class
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hdf5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edmund Highcock