gio2 3.1.0-x64-mingw32 → 3.1.1-x64-mingw32

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: 23010e33ae593c7a029e322498758fd70259ae59
4
- data.tar.gz: 7a0d5a04615212d9cfe6d794ed310e4b8789fd5f
3
+ metadata.gz: 6f9c26c0b6bbdf1e7abc951c9d9b2645e0d74ae9
4
+ data.tar.gz: c8ad2d76e2621a04e19f29f6c4fe67725493dcde
5
5
  SHA512:
6
- metadata.gz: 073514f284005e227eb40364cf5609dd5c354594c13a946c6a660e7b531b7fbc2148b1c021b89d3799eaaa8dfc1b0077d78c51faf661aa7a0d5beaae28ed2237
7
- data.tar.gz: 94e239ac7ad78af9a5d66e87e9591d7b705cb966c0fe426f9f2cb75857271bffb8d1a44ac5b3e3dd16c0682572dab3bdc121374c7bb54baa32949a2523cdf2ef
6
+ metadata.gz: 7230a53aaf9393b7823886d34bdb953680f585e363233e4014f4c27681c142158d7fb46a01a98d879ea6c3d45741bfa1a1a611df3b441e042f0fa8c345807dfc
7
+ data.tar.gz: a8b0f4814bccab0dfde29b94a5d199d79e934cf7adb695312d2ca39c2ea6c6522f28a5e207aae230a2c76ec8a5d528f49fc2d9e7b3ac9269abf6ee0c20bf869b
Binary file
Binary file
Binary file
@@ -16,18 +16,20 @@
16
16
 
17
17
  module Gio
18
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
19
+ if method_defined?(:list_schemas)
20
+ alias_method :list_schemas_raw, :list_schemas
21
+ def list_schemas(recursive_or_options=nil)
22
+ case recursive_or_options
23
+ when true, false
24
+ recursive = recursive_or_options
25
+ else
26
+ options = recursive_or_options || {}
27
+ recursive = options[:recursive]
28
+ recursive = true if recursive.nil?
29
+ end
29
30
 
30
- list_schemas_raw(recursive)
31
+ list_schemas_raw(recursive)
32
+ end
31
33
  end
32
34
  end
33
35
  end
@@ -16,6 +16,30 @@
16
16
 
17
17
  module Gio
18
18
  class Settings
19
+ alias_method :initialize_raw, :initialize
20
+
21
+ def initialize(*args)
22
+ if args.size == 1
23
+ initialize_raw(args[0])
24
+ elsif args.size == 2
25
+ schema_id = args[0]
26
+ options = args[1]
27
+ path = options[:path] || nil
28
+ backend = options[:backend] || nil
29
+ if path && backend
30
+ initialize_new_with_backend_and_path(schema_id, backend, path)
31
+ elsif path
32
+ initialize_new_with_path(schema_id, path)
33
+ elsif backend
34
+ initialize_new_with_backend(schema_id, backend)
35
+ end
36
+ elsif args.size == 3
37
+ initialize_new_full(*args)
38
+ else
39
+ $stderr.puts "Arguments error for Gio::Settings#new"
40
+ end
41
+ end
42
+
19
43
  alias_method :set_value_raw, :set_value
20
44
  def set_value(key, value)
21
45
  schema_key = settings_schema.get_key(key)
@@ -0,0 +1,51 @@
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
+ generated_files = []
22
+
23
+ Rake::FileList["resource/**/*.gresource.xml"].each do |gresource_xml|
24
+ gresource = gresource_xml.gsub(/\.xml\z/, "")
25
+ gresource_dir = File.dirname(gresource_xml)
26
+ generated_files << gresource
27
+ CLEAN << gresource
28
+ dependencies = [gresource_xml] + Rake::FileList["#{gresource_dir}/*.png"]
29
+ file gresource => dependencies do
30
+ cd(gresource_dir) do
31
+ sh("glib-compile-resources", File.basename(gresource_xml))
32
+ end
33
+ end
34
+ end
35
+
36
+ schema_dirs = [
37
+ "schema/default",
38
+ "schema/source",
39
+ ]
40
+ schema_dirs.each do |schema_dir|
41
+ gschema_compiled = File.join(schema_dir, "gschemas.compiled")
42
+ generated_files << gschema_compiled
43
+ CLEAN << gschema_compiled
44
+ file gschema_compiled => Rake::FileList["#{schema_dir}/*.gschema.xml"] do
45
+ cd(schema_dir) do
46
+ sh("glib-compile-schemas", ".")
47
+ end
48
+ end
49
+ end
50
+
51
+ task :default => generated_files
@@ -1,6 +1,6 @@
1
1
  <schemalist>
2
- <schema id="jp.ruby-gnome2.test.value"
3
- path="/jp/ruby-gnome2/test/value/">
2
+ <schema id="jp.ruby-gnome2.test.settings"
3
+ path="/jp/ruby-gnome2/test/settings/">
4
4
  <key name="string" type="s">
5
5
  <default>"default-string"</default>
6
6
  </key>
@@ -16,6 +16,8 @@
16
16
 
17
17
  require "test-unit"
18
18
 
19
+ require "tempfile"
20
+
19
21
  require "gio2-test-utils/fixture"
20
22
  require "gio2-test-utils/omissions"
21
23
  require "gio2-test-utils/socket-client"
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2013-2015 Ruby-GNOME2 Project Team
3
+ # Copyright (C) 2013-2016 Ruby-GNOME2 Project Team
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -38,20 +38,11 @@ modules.each do |target, module_name|
38
38
  $LOAD_PATH.unshift(File.join(target, "lib"))
39
39
  end
40
40
 
41
- Dir.chdir(File.join(gio2_base, "test", "fixture", "resource")) do
42
- system("rake") or exit(false)
43
- end
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
41
+ fixture_dir = File.join(gio2_base, "test", "fixture")
42
+ Dir.chdir(fixture_dir) do
53
43
  system("rake") or exit(false)
54
44
  end
45
+ ENV["GSETTINGS_SCHEMA_DIR"] = File.join(fixture_dir, "schema", "default")
55
46
 
56
47
  $LOAD_PATH.unshift(File.join(glib_base, "test"))
57
48
  require "glib-test-init"
@@ -20,7 +20,7 @@ class TestSettings < Test::Unit::TestCase
20
20
 
21
21
  sub_test_case "accessor" do
22
22
  setup do
23
- @settings = Gio::Settings.new("jp.ruby-gnome2.test.value")
23
+ @settings = Gio::Settings.new("jp.ruby-gnome2.test.settings")
24
24
  end
25
25
 
26
26
  test "string" do
@@ -41,4 +41,90 @@ class TestSettings < Test::Unit::TestCase
41
41
  @settings["boolean"])
42
42
  end
43
43
  end
44
+
45
+ sub_test_case ".new" do
46
+ def need_keyfile_settings_backend
47
+ unless Gio.respond_to?(:keyfile_settings_backend_new)
48
+ omit("Need Gio.keyfile_settings_backend_new")
49
+ end
50
+ end
51
+
52
+ test "minimum" do
53
+ settings = Gio::Settings.new("jp.ruby-gnome2.test.settings")
54
+ settings.reset("string")
55
+ assert_equal("default-string", settings["string"])
56
+ end
57
+
58
+ test ":path" do
59
+ settings = Gio::Settings.new("jp.ruby-gnome2.test.settings",
60
+ :path => "/jp/ruby-gnome2/test/settings/")
61
+ settings.reset("string")
62
+ assert_equal("default-string", settings["string"])
63
+ end
64
+
65
+ test ":backend" do
66
+ need_keyfile_settings_backend
67
+ keyfile = Tempfile.new(["settings", ".ini"])
68
+ backend = Gio::keyfile_settings_backend_new(keyfile.path, "/", "keyfile_settings")
69
+ settings = Gio::Settings.new("jp.ruby-gnome2.test.settings",
70
+ :backend => backend)
71
+
72
+ settings.reset("string")
73
+ assert_equal("default-string", settings["string"])
74
+ settings["string"] = "new-string"
75
+ assert_equal("new-string", settings["string"])
76
+
77
+ keyfile_content_ref = <<-KEYFILE
78
+ [jp/ruby-gnome2/test/settings]
79
+ string='new-string'
80
+ KEYFILE
81
+ keyfile_content = File.read(keyfile.path)
82
+ assert_equal(keyfile_content_ref, keyfile_content)
83
+ FileUtils.rm_f(keyfile)
84
+ end
85
+
86
+ test ":backend and :path" do
87
+ need_keyfile_settings_backend
88
+ keyfile = Tempfile.new(["settings", ".ini"])
89
+ backend = Gio::keyfile_settings_backend_new(keyfile.path, "/", "keyfile_settings")
90
+ settings = Gio::Settings.new("jp.ruby-gnome2.test.settings",
91
+ :backend => backend,
92
+ :path => "/jp/ruby-gnome2/test/settings/")
93
+
94
+ settings.reset("string")
95
+ assert_equal("default-string", settings["string"])
96
+ settings["string"] = "new-string"
97
+ assert_equal("new-string", settings["string"])
98
+
99
+ keyfile_content_ref = <<-KEYFILE
100
+ [jp/ruby-gnome2/test/settings]
101
+ string='new-string'
102
+ KEYFILE
103
+ keyfile_content = File.read(keyfile.path)
104
+ assert_equal(keyfile_content_ref, keyfile_content)
105
+ end
106
+
107
+ test "full" do
108
+ need_keyfile_settings_backend
109
+ keyfile = Tempfile.new(["settings", ".ini"])
110
+ backend = Gio::keyfile_settings_backend_new(keyfile.path, "/", "keyfile_settings")
111
+ schema_source = Gio::SettingsSchemaSource.new(fixture_path("schema"), nil, true)
112
+ schema = schema_source.lookup("jp.ruby-gnome2.test.settings", true)
113
+ settings = Gio::Settings.new(schema,
114
+ backend,
115
+ "/jp/ruby-gnome2/test/settings/")
116
+
117
+ settings.reset("string")
118
+ assert_equal("default-string", settings["string"])
119
+ settings["string"] = "new-string"
120
+ assert_equal("new-string", settings["string"])
121
+
122
+ keyfile_content_ref = <<-KEYFILE
123
+ [jp/ruby-gnome2/test/settings]
124
+ string='new-string'
125
+ KEYFILE
126
+ keyfile_content = File.read(keyfile.path)
127
+ assert_equal(keyfile_content_ref, keyfile_content)
128
+ end
129
+ end
44
130
  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.1.0
4
+ version: 3.1.1
5
5
  platform: x64-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-13 00:00:00.000000000 Z
11
+ date: 2017-01-26 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.1.0
19
+ version: 3.1.1
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.1.0
26
+ version: 3.1.1
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.1.0
33
+ version: 3.1.1
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.1.0
40
+ version: 3.1.1
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: []
@@ -54,6 +54,7 @@ files:
54
54
  - extconf.rb
55
55
  - lib/2.2/gio2.so
56
56
  - lib/2.3/gio2.so
57
+ - lib/2.4/gio2.so
57
58
  - lib/gio2.rb
58
59
  - lib/gio2/action-map.rb
59
60
  - lib/gio2/action.rb
@@ -70,13 +71,12 @@ files:
70
71
  - lib/gio2/settings-schema-source.rb
71
72
  - lib/gio2/settings.rb
72
73
  - lib/gio2/simple-action.rb
74
+ - test/fixture/Rakefile
73
75
  - test/fixture/content-type/x-content/unix-software/autorun.sh
74
76
  - test/fixture/resource/Rakefile
75
77
  - test/fixture/resource/logo.png
76
78
  - 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
79
+ - test/fixture/schema/default/jp.ruby-gnome2.test.settings.gschema.xml
80
80
  - test/fixture/schema/source/jp.ruby-gnome2.test.source.gschema.xml
81
81
  - test/gio2-test-utils.rb
82
82
  - test/gio2-test-utils/fixture.rb
@@ -118,7 +118,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
118
  requirements:
119
119
  - - ">="
120
120
  - !ruby/object:Gem::Version
121
- version: 2.1.0
121
+ version: '2.1'
122
+ - - "<"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.5'
122
125
  required_rubygems_version: !ruby/object:Gem::Requirement
123
126
  requirements:
124
127
  - - ">="
@@ -1,28 +0,0 @@
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
@@ -1,28 +0,0 @@
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