hdf5 0.3.1 → 0.3.2

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 +4 -0
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5a7d2fd35b006365a1df3597b2b870c203ec073
4
- data.tar.gz: bfe6c9b521409d4454ffe8151d86538363f515d8
3
+ metadata.gz: eb8d233eda8a34d92388cfd49edcd4198ef9285f
4
+ data.tar.gz: 80ed4a5ae45a9eaf1e6405a0244568019b9502c4
5
5
  SHA512:
6
- metadata.gz: fa96ae2f04220d8bc0a11fff276c214f837308346a0be02fdcf74fe7a51ba0947bcf4f1384eda335c914fd3bb9c1da3c91a126cdf11ab28ffaae940e8f9063e7
7
- data.tar.gz: ebee6c87c993a06b3fd99c17dd03d33d7c0d9cc269c5c5c97e6faed930fe886ea5519bc4dc0b17181546ca836f0278f09320b1b0cd8816cd8bcf2b5b6058592d
6
+ metadata.gz: 60873c9c3ba02e9ffd7db01271c8fb812973439d5a6fb5a831631d8c6ffdd4cc39aaac9dcaa7bfce2750fa148a6f84ae9d5d057bc0684e1786bbee446f4077fa
7
+ data.tar.gz: 028566d73b1f2fa5605cfc0961afe74dc294ab63fb31da7487b7a5ebd0fec81d2ae5289da6ff42f0d27aaa7726e394b7e111e0b36c92d0266039b6065e956014
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -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.1 ruby lib
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.1"
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"]
@@ -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?
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.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edmund Highcock