corefoundation 0.3.10 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/corefoundation/array.rb +2 -2
- data/lib/corefoundation/base.rb +2 -1
- data/lib/corefoundation/dictionary.rb +2 -2
- data/lib/corefoundation/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4052eded27a6188c93ee482a6d7dfa3d3bf5bcdacbbe9a9801ad1dd86c28790
|
4
|
+
data.tar.gz: 2d6dab3b3d788a0671acfd36781739d763014db6c3a864ea64437ed12719e5bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09ed7185a6cd6046bed44eef079013b5b15a5df17d70c01ac13aa17dcbcae01df39afb5868e40d70409cdd46136cdc2e92d829503a05341ef2b609f5e29cf84a'
|
7
|
+
data.tar.gz: c62e84155e57619823cccc52b9b6ff34cef39d2e657500505bb72b192da809bab178127c70040b6b284dd138bb02377a461d2de65925775d65bc576b87ca7753
|
data/lib/corefoundation/array.rb
CHANGED
@@ -49,7 +49,7 @@ module CF
|
|
49
49
|
range[:location] = 0
|
50
50
|
range[:length] = length
|
51
51
|
callback = lambda do |value, _|
|
52
|
-
yield Base.typecast(value)
|
52
|
+
yield Base.typecast(value)
|
53
53
|
end
|
54
54
|
CF.CFArrayApplyFunction(self, range, callback, nil)
|
55
55
|
self
|
@@ -79,7 +79,7 @@ module CF
|
|
79
79
|
# @param [Integer] index the 0 based index of the item to retrieve. Behaviour is undefined if it is not in the range 0...size
|
80
80
|
# @return [CF::Base] a subclass of CF::Base
|
81
81
|
def [](index)
|
82
|
-
Base.typecast(CF.CFArrayGetValueAtIndex(self, index))
|
82
|
+
Base.typecast(CF.CFArrayGetValueAtIndex(self, index))
|
83
83
|
end
|
84
84
|
|
85
85
|
# Sets object at the index
|
data/lib/corefoundation/base.rb
CHANGED
@@ -33,11 +33,12 @@ module CF
|
|
33
33
|
def initialize(pointer)
|
34
34
|
@ptr = FFI::Pointer.new(pointer)
|
35
35
|
ObjectSpace.define_finalizer(self, self.class.finalize(ptr))
|
36
|
+
CF.retain(ptr)
|
36
37
|
end
|
37
38
|
|
38
39
|
# @param [FFI::Pointer] pointer to the address of the object
|
39
40
|
def self.finalize(pointer)
|
40
|
-
proc { CF.release(pointer
|
41
|
+
proc { CF.release(pointer) unless pointer.address.zero? }
|
41
42
|
end
|
42
43
|
|
43
44
|
# Whether the instance is the CFNull singleton
|
@@ -55,7 +55,7 @@ module CF
|
|
55
55
|
|
56
56
|
def each
|
57
57
|
callback = lambda do |key, value, _|
|
58
|
-
yield [Base.typecast(key)
|
58
|
+
yield [Base.typecast(key), Base.typecast(value)]
|
59
59
|
end
|
60
60
|
CF.CFDictionaryApplyFunction(self, callback, nil)
|
61
61
|
self
|
@@ -70,7 +70,7 @@ module CF
|
|
70
70
|
key = CF::String.from_string(key) if key.is_a?(::String)
|
71
71
|
self.class.check_cftype(key)
|
72
72
|
raw = CF.CFDictionaryGetValue(self, key)
|
73
|
-
raw.null? ? nil : self.class.typecast(raw)
|
73
|
+
raw.null? ? nil : self.class.typecast(raw)
|
74
74
|
end
|
75
75
|
|
76
76
|
# Sets the value associated with the key, or nil
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corefoundation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Frederick Cheung
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - '='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 2.2.
|
62
|
+
version: 2.2.1
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - '='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 2.2.
|
69
|
+
version: 2.2.1
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: yard
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|