corefoundation 0.3.10 → 0.3.19
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: be9765bf11e688dc6c127a51a2f0ab3877689cc50fbdcf09ed2d4568c2252f0a
|
|
4
|
+
data.tar.gz: 67faf5fc9782f5f0f323f73d864a589b520273f45cbdae37e17f25b5cb585c25
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 297558c24664686915fd1cc3475053e2db5bcfe028d0f46cae39e347e6159e0b239e441d86852db3f63d73253582d795fc3ed9c6f5af7674949a6614e8357f3e
|
|
7
|
+
data.tar.gz: 31f271cd193dded15b3f1a344135ded19451547f909345a81d999070f09e482635c03af7c6175a156ac533980a295a4fb988ab0584d8ebfb82d24ea10e1040f6
|
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
|
|
@@ -18,6 +18,7 @@ module CF
|
|
|
18
18
|
attach_function 'CFPreferencesSetValue', [:key, :value, :application_id, :username, :hostname], :void
|
|
19
19
|
|
|
20
20
|
attach_function 'CFPreferencesAppSynchronize', [:application_id], :bool
|
|
21
|
+
attach_function 'CFPreferencesSynchronize', [:application_id, :username, :hostname], :void
|
|
21
22
|
|
|
22
23
|
# Interface to the preference utilities from Corefoundation.framework.
|
|
23
24
|
# Documentation at https://developer.apple.com/documentation/corefoundation/preferences_utilities
|
|
@@ -93,14 +94,16 @@ module CF
|
|
|
93
94
|
arg_to_cf(username),
|
|
94
95
|
arg_to_cf(hostname)
|
|
95
96
|
)
|
|
97
|
+
CF.CFPreferencesSynchronize(application_id.to_cf, arg_to_cf(username), arg_to_cf(hostname))
|
|
98
|
+
true
|
|
96
99
|
else
|
|
97
100
|
CF.CFPreferencesSetAppValue(
|
|
98
101
|
key.to_cf,
|
|
99
102
|
arg_to_cf(value),
|
|
100
103
|
application_id.to_cf
|
|
101
104
|
)
|
|
105
|
+
CF.CFPreferencesAppSynchronize(application_id.to_cf)
|
|
102
106
|
end
|
|
103
|
-
CF.CFPreferencesAppSynchronize(application_id.to_cf)
|
|
104
107
|
end
|
|
105
108
|
|
|
106
109
|
# Calls the {#self.set} method and raise a `PreferenceSyncFailed` error if `false` is returned.
|
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.19
|
|
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:
|
|
12
|
+
date: 2026-06-29 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.2
|
|
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.2
|
|
70
70
|
- !ruby/object:Gem::Dependency
|
|
71
71
|
name: yard
|
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -119,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
119
119
|
requirements:
|
|
120
120
|
- - ">="
|
|
121
121
|
- !ruby/object:Gem::Version
|
|
122
|
-
version: '
|
|
122
|
+
version: '3.1'
|
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
requirements:
|
|
125
125
|
- - ">="
|
|
126
126
|
- !ruby/object:Gem::Version
|
|
127
127
|
version: '0'
|
|
128
128
|
requirements: []
|
|
129
|
-
rubygems_version: 3.
|
|
129
|
+
rubygems_version: 3.3.27
|
|
130
130
|
signing_key:
|
|
131
131
|
specification_version: 4
|
|
132
132
|
summary: Ruby wrapper for macOS Core Foundation framework
|