exempi 0.1 → 0.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.
- checksums.yaml +4 -4
- data/lib/exempi/consts.rb +2 -2
- data/lib/exempi/exempi.rb +12 -9
- data/lib/exempi/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16890b4f1e3046eb87eaced9926f4665d520c01d
|
4
|
+
data.tar.gz: c034e3c8e98b13762632169e9b8204fa5ce0191d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9316bb0223de9c76d665c6bc2782516b674f45cf15476e39f6de20df1b850a44dea2ed21110476d77cb9ef568a8a64cc04bdf062cde30d47742175d10134a12b
|
7
|
+
data.tar.gz: 696d8be4f19e95d31ecc4ad451abcb94843e77665bcdca085475638985b479444d679c15e4c43054dedaead2c656e5a41a181eece896b34d2f1fcd462257f338
|
data/lib/exempi/consts.rb
CHANGED
@@ -263,7 +263,7 @@ module Exempi
|
|
263
263
|
end
|
264
264
|
struct[:nanoSecond] = source.to_time.nsec
|
265
265
|
|
266
|
-
match = source.zone.match
|
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
|
data/lib/exempi/exempi.rb
CHANGED
@@ -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
|
-
|
49
|
-
|
48
|
+
attr_accessor :verbose
|
49
|
+
alias_method :verbose?, :verbose
|
50
50
|
|
51
|
-
def attach_function
|
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
|
-
|
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
|
-
|
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
|
data/lib/exempi/version.rb
CHANGED
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.
|
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:
|
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.
|
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:
|