hdf5 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/hdf5.gemspec +2 -2
- data/lib/hdf5.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb8d233eda8a34d92388cfd49edcd4198ef9285f
|
4
|
+
data.tar.gz: 80ed4a5ae45a9eaf1e6405a0244568019b9502c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60873c9c3ba02e9ffd7db01271c8fb812973439d5a6fb5a831631d8c6ffdd4cc39aaac9dcaa7bfce2750fa148a6f84ae9d5d057bc0684e1786bbee446f4077fa
|
7
|
+
data.tar.gz: 028566d73b1f2fa5605cfc0961afe74dc294ab63fb31da7487b7a5ebd0fec81d2ae5289da6ff42f0d27aaa7726e394b7e111e0b36c92d0266039b6065e956014
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/hdf5.gemspec
CHANGED
@@ -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.
|
5
|
+
# stub: hdf5 0.3.2 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.
|
10
|
+
s.version = "0.3.2"
|
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"]
|
data/lib/hdf5.rb
CHANGED
@@ -107,6 +107,7 @@ module Hdf5
|
|
107
107
|
# file.close
|
108
108
|
#
|
109
109
|
class H5File
|
110
|
+
class InvalidFile < StandardError; end
|
110
111
|
extend FFI::Library
|
111
112
|
ffi_lib H5Library.library_path
|
112
113
|
attach_function :basic_is_hdf5, :H5Fis_hdf5, [:string], H5Types.htri_t
|
@@ -115,8 +116,11 @@ module Hdf5
|
|
115
116
|
attr_reader :id
|
116
117
|
# Open the file with the given filename. Currently read only
|
117
118
|
def initialize(filename)
|
119
|
+
raise Errno::ENOENT.new("File #{filename} does not exist") unless FileTest.exist?(filename)
|
120
|
+
raise InvalidFile.new("File #{filename} is not a valid hdf5 file") unless basic_is_hdf5(filename) > 0
|
118
121
|
@filename = filename
|
119
122
|
@id = basic_open(filename, 0x0000, 0)
|
123
|
+
raise InvalidFile.new("An unknown problem occured opening #{filename}") if @id < 0
|
120
124
|
end
|
121
125
|
# Is the file a valid hdf5 file
|
122
126
|
def is_hdf5?
|