exempi 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8b542870176af4c52ddf7a13d1f4bae891db89b
4
- data.tar.gz: 3cea7bcc51f8f8921f45277bd43980b90dfcd810
3
+ metadata.gz: 16890b4f1e3046eb87eaced9926f4665d520c01d
4
+ data.tar.gz: c034e3c8e98b13762632169e9b8204fa5ce0191d
5
5
  SHA512:
6
- metadata.gz: 8002302d3272d602a1c50ec9e2932bd2c25e00298439d09754b5500c5a817aaacd1614499ae229ccac144fd9c8e826ebcb9d37da247a1d1e7cbd74888b1dda67
7
- data.tar.gz: b95e971af05e2f0b82810031449c511414fa2eb5dcd1e7ceee52677039be54f10680c4fb9c00c76d1529ad00db8ae5f783e4ec37030510496191613a352aa64d
6
+ metadata.gz: 9316bb0223de9c76d665c6bc2782516b674f45cf15476e39f6de20df1b850a44dea2ed21110476d77cb9ef568a8a64cc04bdf062cde30d47742175d10134a12b
7
+ data.tar.gz: 696d8be4f19e95d31ecc4ad451abcb94843e77665bcdca085475638985b479444d679c15e4c43054dedaead2c656e5a41a181eece896b34d2f1fcd462257f338
@@ -263,7 +263,7 @@ module Exempi
263
263
  end
264
264
  struct[:nanoSecond] = source.to_time.nsec
265
265
 
266
- match = source.zone.match /(?<sign>[-+]){1}(?<hour>\d\d){1}:(?<minute>\d\d){1}/
266
+ match = source.zone.match(/(?<sign>[-+]){1}(?<hour>\d\d){1}:(?<minute>\d\d){1}/)
267
267
  if match
268
268
  if match[:sign] == '-' then struct[:tzSign] = -1
269
269
  elsif match[:hour] == '00' && match[:minute] == '00' then struct[:tzSign] = 0
@@ -335,4 +335,4 @@ module Exempi
335
335
 
336
336
  opt_hash
337
337
  end
338
- end
338
+ end
@@ -45,11 +45,11 @@ module Exempi
45
45
 
46
46
  # we redefine attach_function so we can wrap all of the C functions
47
47
  class << self
48
- def verbose?; @verbose; end
49
- attr_writer :verbose
48
+ attr_accessor :verbose
49
+ alias_method :verbose?, :verbose
50
50
 
51
- def attach_function name, func, args, returns=nil, options={}
52
- super
51
+ def attach_function(name, func, arguments, returns=nil, options={})
52
+ super(name, func, arguments, returns, options)
53
53
  old_method = method(name)
54
54
  define_singleton_method(name) do |*args|
55
55
  shutup! { old_method.call(*args) }
@@ -61,14 +61,17 @@ module Exempi
61
61
  # Exempi spews stderr all over the place without giving you any way
62
62
  # to quiet it! Boo!
63
63
  def shutup!
64
- if not verbose?
64
+ unless verbose?
65
65
  io = IO.new 2
66
66
  stderr = io.dup
67
67
  io.reopen IO::NULL
68
68
  end
69
69
  yield
70
70
  ensure
71
- io.reopen stderr unless verbose?
71
+ unless verbose?
72
+ io.reopen stderr
73
+ stderr.close
74
+ end
72
75
  end
73
76
  end
74
77
 
@@ -82,8 +85,8 @@ module Exempi
82
85
  attach_function :xmp_get_error, [ ], :int
83
86
 
84
87
  attach_function :xmp_files_new, [ ], :pointer
85
- attach_function :xmp_files_open_new, [ :string, XmpOpenFileOptions ], :pointer
86
- attach_function :xmp_files_open, [ :pointer, :string, XmpOpenFileOptions ], :bool
88
+ attach_function :xmp_files_open_new, [ :string, XmpOpenFileOptions ], :pointer, {blocking: true}
89
+ attach_function :xmp_files_open, [ :pointer, :string, XmpOpenFileOptions ], :bool, {blocking: true}
87
90
 
88
91
  # Close an XMP file. Will flush the changes.
89
92
  # @param [FFI::Pointer, FFI::MemoryPointer] xf the file object
@@ -322,4 +325,4 @@ module Exempi
322
325
 
323
326
  # We do this first, before anything else!!
324
327
  xmp_init
325
- end
328
+ end
@@ -1,3 +1,3 @@
1
1
  module Exempi
2
- VERSION = "0.1"
2
+ VERSION = "0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exempi
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Misty De Meo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-03 00:00:00.000000000 Z
11
+ date: 2016-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  version: '0'
85
85
  requirements: []
86
86
  rubyforge_project:
87
- rubygems_version: 2.4.5.1
87
+ rubygems_version: 2.5.2
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: Ruby wrapper for Exempi
@@ -92,4 +92,3 @@ test_files:
92
92
  - test/dataconverter_test.rb
93
93
  - test/datetime_test.rb
94
94
  - test/helpers_test.rb
95
- has_rdoc: