gio2 3.0.9-x86-mingw32 → 3.1.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2.2/gio2.so +0 -0
- data/lib/2.3/gio2.so +0 -0
- data/lib/gio2/action-map.rb +3 -2
- data/lib/gio2/content-type.rb +28 -0
- data/lib/gio2/file.rb +30 -0
- data/lib/gio2/loader.rb +19 -64
- data/lib/gio2/resources.rb +8 -4
- data/lib/gio2/settings-schema-source.rb +33 -0
- data/lib/gio2/settings.rb +29 -0
- data/test/fixture/schema/settings/Rakefile +28 -0
- data/test/fixture/schema/settings/jp.ruby-gnome2.test.value.gschema.xml +11 -0
- data/test/fixture/schema/source/Rakefile +28 -0
- data/test/fixture/schema/source/jp.ruby-gnome2.test.source.gschema.xml +5 -0
- data/test/gio2-test-utils/omissions.rb +6 -0
- data/test/run-test.rb +11 -0
- data/test/test-settings-schema-source.rb +56 -0
- data/test/test-settings.rb +44 -0
- metadata +17 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd4aba65b639514522725d573eba7ce359d9e6d7
|
4
|
+
data.tar.gz: b63f03b25fead5e90725a3dbd57d3e8bf70549ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72ba308726653004b2f01fcac9fc7fc7e6f76b62e912864d89c8579c9e7f69bad8234f8e9e1b9eb95b17409879b4ba95b484025b02902785c03e39d1756a212b
|
7
|
+
data.tar.gz: 8fba8876914df9d4573e1c2da8b75ba6f96ef6100e0550c4ab344ad09394c182b7e0f7f1b8bc3323f4d79fa2574e16a038608be7dae973df02923b6cbd1bf5b2
|
data/lib/2.2/gio2.so
CHANGED
Binary file
|
data/lib/2.3/gio2.so
CHANGED
Binary file
|
data/lib/gio2/action-map.rb
CHANGED
@@ -37,15 +37,16 @@ module Gio
|
|
37
37
|
|
38
38
|
private
|
39
39
|
def actions
|
40
|
-
@
|
40
|
+
@actions ||= {}
|
41
41
|
end
|
42
42
|
|
43
43
|
def convert_to_action(definition)
|
44
44
|
name = definition[:name]
|
45
45
|
parameter_type = definition[:parameter_type]
|
46
|
+
state = definition[:state]
|
46
47
|
callback = definition[:callback]
|
47
48
|
|
48
|
-
action = SimpleAction.new(name, parameter_type)
|
49
|
+
action = SimpleAction.new(name, parameter_type, state)
|
49
50
|
if callback
|
50
51
|
action.signal_connect("activate") do |*args|
|
51
52
|
callback.call(*args)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Copyright (C) 2016 Ruby-GNOME2 Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
module Gio
|
18
|
+
class ContentType
|
19
|
+
class << self
|
20
|
+
alias_method :registered_raw, :registered
|
21
|
+
def registered
|
22
|
+
registered_raw([]).collect do |type|
|
23
|
+
new(type)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/gio2/file.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Copyright (C) 2016 Ruby-GNOME2 Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
module Gio
|
18
|
+
module File
|
19
|
+
class << self
|
20
|
+
alias_method :commandline_arg_raw, :commandline_arg
|
21
|
+
def commandline_arg(arg, cwd=nil)
|
22
|
+
if cwd
|
23
|
+
commandline_arg_and_cwd(arg, cwd)
|
24
|
+
else
|
25
|
+
commandline_arg_raw(arg)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/gio2/loader.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2013-
|
1
|
+
# Copyright (C) 2013-2016 Ruby-GNOME2 Project Team
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -31,7 +31,7 @@ module Gio
|
|
31
31
|
info = @content_type_guess_for_tree_info
|
32
32
|
file_module = @base_module.const_get("File")
|
33
33
|
file_module.__send__(:define_method, "guess_content_types") do
|
34
|
-
info.invoke(
|
34
|
+
info.invoke([self]).collect do |type|
|
35
35
|
content_type_class.new(type)
|
36
36
|
end
|
37
37
|
end
|
@@ -53,11 +53,15 @@ module Gio
|
|
53
53
|
require "gio2/action"
|
54
54
|
require "gio2/action-map"
|
55
55
|
require "gio2/application-command-line"
|
56
|
+
require "gio2/content-type"
|
57
|
+
require "gio2/file"
|
56
58
|
require "gio2/inet-address"
|
57
59
|
require "gio2/input-stream"
|
58
60
|
require "gio2/pollable-input-stream"
|
59
61
|
require "gio2/pollable-output-stream"
|
60
62
|
require "gio2/resources"
|
63
|
+
require "gio2/settings"
|
64
|
+
require "gio2/settings-schema-source"
|
61
65
|
require "gio2/simple-action"
|
62
66
|
|
63
67
|
require "gio2/deprecated"
|
@@ -105,24 +109,20 @@ module Gio
|
|
105
109
|
when /\Acontent_type_/
|
106
110
|
load_function_info_content_type(info)
|
107
111
|
when "content_types_get_registered"
|
108
|
-
@content_type_class
|
109
|
-
info.invoke(:arguments => []).collect do |type|
|
110
|
-
new(type)
|
111
|
-
end
|
112
|
-
end
|
112
|
+
define_singleton_method(@content_type_class, "registered", info)
|
113
113
|
when /\Aresources_/
|
114
114
|
name = rubyish_method_name(info, :prefix => "resources_")
|
115
|
-
|
115
|
+
define_singleton_method(@resources_module, name, info)
|
116
116
|
when /\Adbus_/
|
117
117
|
name = rubyish_method_name(info, :prefix => "dbus_")
|
118
|
-
|
118
|
+
define_singleton_method(@dbus_module, name, info)
|
119
119
|
else
|
120
120
|
super
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
124
|
def load_function_info_content_type(info)
|
125
|
-
name = info
|
125
|
+
name = rubyish_method_name(info, :prefix => "content_type_")
|
126
126
|
case name
|
127
127
|
when "equals", "is_a"
|
128
128
|
case name
|
@@ -136,19 +136,19 @@ module Gio
|
|
136
136
|
other = other.to_s
|
137
137
|
end
|
138
138
|
if other.is_a?(String)
|
139
|
-
info.invoke(
|
139
|
+
info.invoke([to_s, other])
|
140
140
|
else
|
141
141
|
false
|
142
142
|
end
|
143
143
|
end
|
144
144
|
when "from_mime_type"
|
145
145
|
@mime_type_class.__send__(:define_method, "content_type") do
|
146
|
-
info.invoke(
|
146
|
+
info.invoke([to_s])
|
147
147
|
end
|
148
148
|
when "get_mime_type"
|
149
149
|
mime_type_class = @mime_type_class
|
150
150
|
@content_type_class.__send__(:define_method, "mime_type") do
|
151
|
-
mime_type = info.invoke(
|
151
|
+
mime_type = info.invoke([to_s])
|
152
152
|
if mime_type
|
153
153
|
mime_type_class.new(mime_type)
|
154
154
|
else
|
@@ -158,74 +158,29 @@ module Gio
|
|
158
158
|
when "guess_for_tree"
|
159
159
|
@content_type_guess_for_tree_info = info
|
160
160
|
when "guess"
|
161
|
-
|
162
|
-
method_name = "#{@content_type_class}.#{name}"
|
163
|
-
validate_arguments(info, method_name, arguments)
|
164
|
-
end
|
165
|
-
@content_type_class.define_singleton_method(:guess) do |*arguments|
|
166
|
-
validate.call(arguments)
|
167
|
-
info.invoke(:arguments => arguments)
|
168
|
-
end
|
161
|
+
define_singleton_method(@content_type_class, name, info)
|
169
162
|
else
|
170
163
|
case name
|
171
|
-
when /\Acan_be_/
|
172
|
-
method_name = "#{$POSTMATCH}?"
|
173
|
-
when /\Ais_/
|
174
|
-
method_name = "#{$POSTMATCH}?"
|
175
164
|
when /\Aget_/
|
176
165
|
method_name = $POSTMATCH
|
177
166
|
else
|
178
167
|
method_name = name
|
179
168
|
end
|
180
169
|
@content_type_class.__send__(:define_method, method_name) do
|
181
|
-
info.invoke(
|
170
|
+
info.invoke([to_s])
|
182
171
|
end
|
183
172
|
end
|
184
173
|
end
|
185
174
|
|
186
|
-
def
|
187
|
-
case
|
188
|
-
when
|
189
|
-
|
175
|
+
def rubyish_method_name(info, options={})
|
176
|
+
case info.name
|
177
|
+
when /\Anew_(?:for_)?/
|
178
|
+
$POSTMATCH
|
190
179
|
else
|
191
180
|
super
|
192
181
|
end
|
193
182
|
end
|
194
183
|
|
195
|
-
def load_function_infos_file(infos, klass)
|
196
|
-
new_for_commandline_arg_infos = []
|
197
|
-
|
198
|
-
infos.each do |info|
|
199
|
-
name = info.name
|
200
|
-
case name
|
201
|
-
when /\Anew_for_commandline_arg/
|
202
|
-
new_for_commandline_arg_infos << info
|
203
|
-
when /\Anew_(?:for_)?/
|
204
|
-
method_name = $POSTMATCH
|
205
|
-
define_singleton_method(klass, method_name, info)
|
206
|
-
else
|
207
|
-
define_singleton_method(klass, name, info)
|
208
|
-
end
|
209
|
-
end
|
210
|
-
|
211
|
-
define_file_commandline_arg(new_for_commandline_arg_infos, klass)
|
212
|
-
end
|
213
|
-
|
214
|
-
def define_file_commandline_arg(infos, klass)
|
215
|
-
method_name = "commandline_arg"
|
216
|
-
find_info = lambda do |arguments|
|
217
|
-
find_suitable_callable_info(infos, arguments)
|
218
|
-
end
|
219
|
-
validate = lambda do |info, arguments|
|
220
|
-
validate_arguments(info, "#{klass}.#{method_name}", arguments)
|
221
|
-
end
|
222
|
-
klass.__send__(:define_method, method_name) do |*arguments|
|
223
|
-
info = find_info.call(arguments)
|
224
|
-
validate.call(info, arguments)
|
225
|
-
info.invoke(:arguments => arguments)
|
226
|
-
end
|
227
|
-
end
|
228
|
-
|
229
184
|
def rubyish_class_name(info)
|
230
185
|
case info.name
|
231
186
|
when /Enum\z/
|
data/lib/gio2/resources.rb
CHANGED
@@ -17,12 +17,16 @@
|
|
17
17
|
module Gio
|
18
18
|
module Resources
|
19
19
|
class << self
|
20
|
-
|
21
|
-
resource
|
20
|
+
unless method_defined?(:register)
|
21
|
+
def register(resource)
|
22
|
+
resource._register
|
23
|
+
end
|
22
24
|
end
|
23
25
|
|
24
|
-
|
25
|
-
resource
|
26
|
+
unless method_defined?(:unregister)
|
27
|
+
def unregister(resource)
|
28
|
+
resource._unregister
|
29
|
+
end
|
26
30
|
end
|
27
31
|
|
28
32
|
alias_method :lookup_data_raw, :lookup_data
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Copyright (C) 2016 Ruby-GNOME2 Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
module Gio
|
18
|
+
class SettingsSchemaSource
|
19
|
+
alias_method :list_schemas_raw, :list_schemas
|
20
|
+
def list_schemas(recursive_or_options=nil)
|
21
|
+
case recursive_or_options
|
22
|
+
when true, false
|
23
|
+
recursive = recursive_or_options
|
24
|
+
else
|
25
|
+
options = recursive_or_options || {}
|
26
|
+
recursive = options[:recursive]
|
27
|
+
recursive = true if recursive.nil?
|
28
|
+
end
|
29
|
+
|
30
|
+
list_schemas_raw(recursive)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Copyright (C) 2016 Ruby-GNOME2 Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
module Gio
|
18
|
+
class Settings
|
19
|
+
alias_method :set_value_raw, :set_value
|
20
|
+
def set_value(key, value)
|
21
|
+
schema_key = settings_schema.get_key(key)
|
22
|
+
variant_value = GLib::Variant.new(value, schema_key.value_type)
|
23
|
+
set_value_raw(key, variant_value)
|
24
|
+
end
|
25
|
+
|
26
|
+
alias_method :[], :get_value
|
27
|
+
alias_method :[]=, :set_value
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2016 Ruby-GNOME2 Project Team
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
19
|
+
require "rake/clean"
|
20
|
+
|
21
|
+
gschemas_compiled = "gschemas.compiled"
|
22
|
+
|
23
|
+
CLEAN << gschemas_compiled
|
24
|
+
file gschemas_compiled => Rake::FileList["*.gschema.xml"] do
|
25
|
+
sh("glib-compile-schemas", ".")
|
26
|
+
end
|
27
|
+
|
28
|
+
task :default => gschemas_compiled
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<schemalist>
|
2
|
+
<schema id="jp.ruby-gnome2.test.value"
|
3
|
+
path="/jp/ruby-gnome2/test/value/">
|
4
|
+
<key name="string" type="s">
|
5
|
+
<default>"default-string"</default>
|
6
|
+
</key>
|
7
|
+
<key name="boolean" type="b">
|
8
|
+
<default>true</default>
|
9
|
+
</key>
|
10
|
+
</schema>
|
11
|
+
</schemalist>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2016 Ruby-GNOME2 Project Team
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
19
|
+
require "rake/clean"
|
20
|
+
|
21
|
+
gschemas_compiled = "gschemas.compiled"
|
22
|
+
|
23
|
+
CLEAN << gschemas_compiled
|
24
|
+
file gschemas_compiled => Rake::FileList["*.gschema.xml"] do
|
25
|
+
sh("glib-compile-schemas", ".")
|
26
|
+
end
|
27
|
+
|
28
|
+
task :default => gschemas_compiled
|
@@ -23,5 +23,11 @@ module GioTestUtils
|
|
23
23
|
def omit_on_travis_ci
|
24
24
|
omit("Skip this test on Travis CI") if ENV["CI"]
|
25
25
|
end
|
26
|
+
|
27
|
+
def only_gio_version(major, minor, micro)
|
28
|
+
unless GLib.check_version?(major, minor, micro)
|
29
|
+
omit("Require GIO >= #{major}.#{minor}.#{micro}")
|
30
|
+
end
|
31
|
+
end
|
26
32
|
end
|
27
33
|
end
|
data/test/run-test.rb
CHANGED
@@ -42,6 +42,17 @@ Dir.chdir(File.join(gio2_base, "test", "fixture", "resource")) do
|
|
42
42
|
system("rake") or exit(false)
|
43
43
|
end
|
44
44
|
|
45
|
+
schema_dir = File.join(gio2_base, "test", "fixture", "schema")
|
46
|
+
settings_schema_dir = File.join(schema_dir, "settings")
|
47
|
+
Dir.chdir(settings_schema_dir) do
|
48
|
+
system("rake") or exit(false)
|
49
|
+
end
|
50
|
+
ENV["GSETTINGS_SCHEMA_DIR"] = settings_schema_dir
|
51
|
+
|
52
|
+
Dir.chdir(File.join(schema_dir, "source")) do
|
53
|
+
system("rake") or exit(false)
|
54
|
+
end
|
55
|
+
|
45
56
|
$LOAD_PATH.unshift(File.join(glib_base, "test"))
|
46
57
|
require "glib-test-init"
|
47
58
|
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Copyright (C) 2016 Ruby-GNOME2 Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
class TestSettingsSchemaSource < Test::Unit::TestCase
|
18
|
+
include GioTestUtils::Fixture
|
19
|
+
include GioTestUtils::Omissions
|
20
|
+
|
21
|
+
sub_test_case "#list_schemas" do
|
22
|
+
setup do
|
23
|
+
only_gio_version(2, 42, 0)
|
24
|
+
@default_source = Gio::SettingsSchemaSource.default
|
25
|
+
@source = Gio::SettingsSchemaSource.new(fixture_path("schema", "source"),
|
26
|
+
@default_source,
|
27
|
+
true)
|
28
|
+
end
|
29
|
+
|
30
|
+
test "recursive: default" do
|
31
|
+
assert_equal(@source.list_schemas(:recursive => true),
|
32
|
+
@source.list_schemas)
|
33
|
+
end
|
34
|
+
|
35
|
+
test "recursive: true" do
|
36
|
+
non_relocatables_expected, relocatables_expected =
|
37
|
+
@default_source.list_schemas
|
38
|
+
non_relocatables_expected << "jp.ruby-gnome2.test.source"
|
39
|
+
non_relocatables_actual, relocatables_actual =
|
40
|
+
@source.list_schemas(:recursive => true)
|
41
|
+
assert_equal([
|
42
|
+
non_relocatables_expected.sort,
|
43
|
+
relocatables_expected,
|
44
|
+
],
|
45
|
+
[
|
46
|
+
non_relocatables_actual.sort,
|
47
|
+
relocatables_actual,
|
48
|
+
])
|
49
|
+
end
|
50
|
+
|
51
|
+
test "recursive: false" do
|
52
|
+
assert_equal([["jp.ruby-gnome2.test.source"], []],
|
53
|
+
@source.list_schemas(:recursive => false))
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Copyright (C) 2016 Ruby-GNOME2 Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
class TestSettings < Test::Unit::TestCase
|
18
|
+
include GioTestUtils::Fixture
|
19
|
+
include GioTestUtils::Omissions
|
20
|
+
|
21
|
+
sub_test_case "accessor" do
|
22
|
+
setup do
|
23
|
+
@settings = Gio::Settings.new("jp.ruby-gnome2.test.value")
|
24
|
+
end
|
25
|
+
|
26
|
+
test "string" do
|
27
|
+
@settings.reset("string")
|
28
|
+
assert_equal("default-string",
|
29
|
+
@settings["string"])
|
30
|
+
@settings["string"] = "new-string"
|
31
|
+
assert_equal("new-string",
|
32
|
+
@settings["string"])
|
33
|
+
end
|
34
|
+
|
35
|
+
test "boolean" do
|
36
|
+
@settings.reset("boolean")
|
37
|
+
assert_equal(true,
|
38
|
+
@settings["boolean"])
|
39
|
+
@settings["boolean"] = false
|
40
|
+
assert_equal(false,
|
41
|
+
@settings["boolean"])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gio2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME2 Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glib2
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.0
|
19
|
+
version: 3.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.0
|
26
|
+
version: 3.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gobject-introspection
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0
|
33
|
+
version: 3.1.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.0
|
40
|
+
version: 3.1.0
|
41
41
|
description: Ruby/GIO2 is a Ruby binding of gio-2.x.
|
42
42
|
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
43
43
|
executables: []
|
@@ -58,18 +58,26 @@ files:
|
|
58
58
|
- lib/gio2/action-map.rb
|
59
59
|
- lib/gio2/action.rb
|
60
60
|
- lib/gio2/application-command-line.rb
|
61
|
+
- lib/gio2/content-type.rb
|
61
62
|
- lib/gio2/deprecated.rb
|
63
|
+
- lib/gio2/file.rb
|
62
64
|
- lib/gio2/inet-address.rb
|
63
65
|
- lib/gio2/input-stream.rb
|
64
66
|
- lib/gio2/loader.rb
|
65
67
|
- lib/gio2/pollable-input-stream.rb
|
66
68
|
- lib/gio2/pollable-output-stream.rb
|
67
69
|
- lib/gio2/resources.rb
|
70
|
+
- lib/gio2/settings-schema-source.rb
|
71
|
+
- lib/gio2/settings.rb
|
68
72
|
- lib/gio2/simple-action.rb
|
69
73
|
- test/fixture/content-type/x-content/unix-software/autorun.sh
|
70
74
|
- test/fixture/resource/Rakefile
|
71
75
|
- test/fixture/resource/logo.png
|
72
76
|
- test/fixture/resource/ruby-gio2.gresource.xml
|
77
|
+
- test/fixture/schema/settings/Rakefile
|
78
|
+
- test/fixture/schema/settings/jp.ruby-gnome2.test.value.gschema.xml
|
79
|
+
- test/fixture/schema/source/Rakefile
|
80
|
+
- test/fixture/schema/source/jp.ruby-gnome2.test.source.gschema.xml
|
73
81
|
- test/gio2-test-utils.rb
|
74
82
|
- test/gio2-test-utils/fixture.rb
|
75
83
|
- test/gio2-test-utils/omissions.rb
|
@@ -94,6 +102,8 @@ files:
|
|
94
102
|
- test/test-pollable-input-stream.rb
|
95
103
|
- test/test-pollable-output-stream.rb
|
96
104
|
- test/test-resources.rb
|
105
|
+
- test/test-settings-schema-source.rb
|
106
|
+
- test/test-settings.rb
|
97
107
|
- test/test-simple-action.rb
|
98
108
|
- test/test-version.rb
|
99
109
|
homepage: http://ruby-gnome2.sourceforge.jp/
|
@@ -116,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
126
|
version: '0'
|
117
127
|
requirements: []
|
118
128
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
129
|
+
rubygems_version: 2.5.1
|
120
130
|
signing_key:
|
121
131
|
specification_version: 4
|
122
132
|
summary: Ruby/GIO2 is a Ruby binding of gio-2.x.
|