gio2 3.1.0-x86-mingw32 → 3.1.1-x86-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: fd4aba65b639514522725d573eba7ce359d9e6d7
4
- data.tar.gz: b63f03b25fead5e90725a3dbd57d3e8bf70549ca
3
+ metadata.gz: f0607a7ef39e0e3caceac723cd68da4ecfe9b3a2
4
+ data.tar.gz: 815e34e752114f22435a4eb827103b29665415b6
5
5
  SHA512:
6
- metadata.gz: 72ba308726653004b2f01fcac9fc7fc7e6f76b62e912864d89c8579c9e7f69bad8234f8e9e1b9eb95b17409879b4ba95b484025b02902785c03e39d1756a212b
7
- data.tar.gz: 8fba8876914df9d4573e1c2da8b75ba6f96ef6100e0550c4ab344ad09394c182b7e0f7f1b8bc3323f4d79fa2574e16a038608be7dae973df02923b6cbd1bf5b2
6
+ metadata.gz: 4a6f73995737b9917cca97f126864eb0ecf34c39e0991dbe6424568dce5a027c9e53a755b379c94194c6f8ab6579d2e53b1c0140612f1095df099993833902d4
7
+ data.tar.gz: cf1dc51c27e4b79793105011438032ce6445fed00e60213f64dd2f21db87819384cceb3446885ca623692eb77440cccb7576efcb18673de3ad215c3f048bac65
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: 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-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