glib2 2.2.5 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +53 -8
- data/ext/glib2/extconf.rb +1 -1
- data/ext/glib2/glib2.def +8 -0
- data/ext/glib2/rbglib-variant-type.c +296 -0
- data/ext/glib2/rbglib-variant.c +132 -0
- data/ext/glib2/rbglib.c +16 -1
- data/ext/glib2/rbglib.h +18 -7
- data/ext/glib2/rbglib2conversions.h +6 -1
- data/ext/glib2/rbglib_fileutils.c +3 -3
- data/ext/glib2/rbglib_maincontext.c +35 -5
- data/ext/glib2/rbgobj_binding.c +48 -0
- data/ext/glib2/rbgobj_boxed.c +6 -2
- data/ext/glib2/rbgobj_enums.c +55 -12
- data/ext/glib2/rbgobj_flags.c +115 -70
- data/ext/glib2/rbgobj_object.c +91 -77
- data/ext/glib2/rbgobj_type.c +1 -1
- data/ext/glib2/rbgobj_typeinstance.c +8 -2
- data/ext/glib2/rbgobj_value.c +20 -12
- data/ext/glib2/rbgobject.c +2 -0
- data/ext/glib2/rbgobject.h +4 -2
- data/ext/glib2/rbgprivate.h +4 -3
- data/ext/glib2/rbgutil.c +36 -8
- data/ext/glib2/rbgutil.h +3 -1
- data/ext/glib2/rbgutil_list.c +97 -1
- data/ext/glib2/rbgutil_list.h +10 -1
- data/lib/glib2/deprecatable.rb +20 -5
- data/lib/gnome2/rake/native-binary-build-task.rb +1 -1
- data/lib/gnome2/rake/windows-binary-build-task.rb +12 -15
- data/lib/mkmf-gnome2.rb +10 -11
- data/test/test-binding.rb +97 -0
- data/test/test-variant-type.rb +357 -0
- data/test/test_enum.rb +5 -8
- data/test/test_file_utils.rb +30 -8
- data/test/test_source.rb +11 -0
- data/test/test_value.rb +5 -0
- metadata +7 -3
- data/README +0 -40
data/test/test_enum.rb
CHANGED
@@ -36,11 +36,11 @@ class TestEnum < Test::Unit::TestCase
|
|
36
36
|
assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, "KEEP_COMMENTS")
|
37
37
|
assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, "keep COMMENTS")
|
38
38
|
|
39
|
-
assert_raise(
|
39
|
+
assert_raise(ArgumentError) do
|
40
40
|
assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, :unknown)
|
41
41
|
end
|
42
42
|
|
43
|
-
assert_raise(
|
43
|
+
assert_raise(ArgumentError) do
|
44
44
|
assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS, "UNKNOWN")
|
45
45
|
end
|
46
46
|
end
|
@@ -58,12 +58,9 @@ class TestEnum < Test::Unit::TestCase
|
|
58
58
|
assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS |
|
59
59
|
GLib::KeyFile::KEEP_TRANSLATIONS,
|
60
60
|
[:keep_comments, GLib::KeyFile::KEEP_TRANSLATIONS])
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
GLib::KeyFile::KEEP_TRANSLATIONS,
|
65
|
-
[:keep_comments, nil, :keep_translations])
|
66
|
-
end
|
61
|
+
assert_key_file_load(GLib::KeyFile::KEEP_COMMENTS |
|
62
|
+
GLib::KeyFile::KEEP_TRANSLATIONS,
|
63
|
+
[:keep_comments, nil, :keep_translations])
|
67
64
|
end
|
68
65
|
|
69
66
|
def test_flags_or
|
data/test/test_file_utils.rb
CHANGED
@@ -3,14 +3,31 @@
|
|
3
3
|
class TestGLibFileUtils < Test::Unit::TestCase
|
4
4
|
include GLibTestUtils
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
sub_test_case "#format_size_for_display" do
|
7
|
+
def setup
|
8
|
+
only_glib_version(2, 16, 0)
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_kb
|
12
|
+
assert_equal("1.0 KB", GLib.format_size_for_display(1024))
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_10kb
|
16
|
+
assert_equal("10.0 KB", GLib.format_size_for_display(1024 * 10))
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_mb
|
20
|
+
assert_equal("1.0 MB", GLib.format_size_for_display(1024 * 1024))
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_gb
|
24
|
+
assert_equal("1.0 GB", GLib.format_size_for_display(1024 * 1024 * 1024))
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_over_guint32_value
|
28
|
+
guint32_max = 2 ** 32 - 1
|
29
|
+
assert_equal("4.0 GB", GLib.format_size_for_display(guint32_max + 1))
|
30
|
+
end
|
14
31
|
end
|
15
32
|
|
16
33
|
sub_test_case "#format_size" do
|
@@ -30,6 +47,11 @@ class TestGLibFileUtils < Test::Unit::TestCase
|
|
30
47
|
assert_equal("1.0 GB", GLib.format_size(1000 * 1000 * 1000))
|
31
48
|
end
|
32
49
|
|
50
|
+
def test_over_guint32_value
|
51
|
+
guint32_max = 2 ** 32 - 1
|
52
|
+
assert_equal("4.3 GB", GLib.format_size(guint32_max + 1))
|
53
|
+
end
|
54
|
+
|
33
55
|
sub_test_case "flags" do
|
34
56
|
sub_test_case ":iec_units" do
|
35
57
|
def format_size(size)
|
data/test/test_source.rb
CHANGED
@@ -32,12 +32,23 @@ class TestGLibSource < Test::Unit::TestCase
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def test_destroy
|
35
|
+
# only_glib_version(2, 35, 4)
|
36
|
+
# GMainContext may be freed before GSource by Ruby's GC.
|
37
|
+
# If GMainContext is freed before GSource, GLib 2.35.3 or earlier is
|
38
|
+
# crashed.
|
39
|
+
#
|
40
|
+
# See also:
|
41
|
+
# * https://bugzilla.gnome.org/show_bug.cgi?id=661767
|
42
|
+
# * https://git.gnome.org/browse/glib/commit/?id=26056558be4656ee6e891a4fae5d4198de7519cf
|
43
|
+
|
35
44
|
context = GLib::MainContext.new
|
36
45
|
source = GLib::Idle.source_new
|
37
46
|
id = source.attach(context)
|
38
47
|
assert_not_nil(context.find_source(id))
|
39
48
|
source.destroy
|
40
49
|
assert_nil(context.find_source(id))
|
50
|
+
source = nil
|
51
|
+
GC.start
|
41
52
|
end
|
42
53
|
|
43
54
|
def test_name
|
data/test/test_value.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glib2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Ruby-GNOME2 Project Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pkg-config
|
@@ -45,7 +45,6 @@ extensions:
|
|
45
45
|
- ext/glib2/extconf.rb
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- README
|
49
48
|
- Rakefile
|
50
49
|
- ext/glib2/depend
|
51
50
|
- ext/glib2/extconf.rb
|
@@ -53,6 +52,8 @@ files:
|
|
53
52
|
- ext/glib2/glib-enum-types.h
|
54
53
|
- ext/glib2/glib2.def
|
55
54
|
- ext/glib2/rbgcompat.h
|
55
|
+
- ext/glib2/rbglib-variant-type.c
|
56
|
+
- ext/glib2/rbglib-variant.c
|
56
57
|
- ext/glib2/rbglib.c
|
57
58
|
- ext/glib2/rbglib.h
|
58
59
|
- ext/glib2/rbglib2conversions.h
|
@@ -88,6 +89,7 @@ files:
|
|
88
89
|
- ext/glib2/rbglib_win32.c
|
89
90
|
- ext/glib2/rbglibdeprecated.c
|
90
91
|
- ext/glib2/rbglibdeprecated.h
|
92
|
+
- ext/glib2/rbgobj_binding.c
|
91
93
|
- ext/glib2/rbgobj_boxed.c
|
92
94
|
- ext/glib2/rbgobj_closure.c
|
93
95
|
- ext/glib2/rbgobj_convert.c
|
@@ -145,6 +147,8 @@ files:
|
|
145
147
|
- test/glib-test-init.rb
|
146
148
|
- test/glib-test-utils.rb
|
147
149
|
- test/run-test.rb
|
150
|
+
- test/test-binding.rb
|
151
|
+
- test/test-variant-type.rb
|
148
152
|
- test/test_enum.rb
|
149
153
|
- test/test_file_utils.rb
|
150
154
|
- test/test_flags.rb
|
data/README
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
Ruby/GLib2
|
2
|
-
==========
|
3
|
-
Ruby/GLib2 is a Ruby binding of GLib-2.12.x.
|
4
|
-
|
5
|
-
Requirements
|
6
|
-
------------
|
7
|
-
|
8
|
-
Ruby >= 1.9.x: http://www.ruby-lang.org/
|
9
|
-
pkg-config.rb: http://github.com/rcairo/pkg-config
|
10
|
-
GLib >= 2.12.x: http://www.gtk.org/
|
11
|
-
|
12
|
-
Install (RubyGems)
|
13
|
-
------------------
|
14
|
-
|
15
|
-
% sudo gem install glib2
|
16
|
-
|
17
|
-
Windows:
|
18
|
-
|
19
|
-
> gem install glib2 --platform x86-mingw32
|
20
|
-
|
21
|
-
Install (traditional)
|
22
|
-
---------------------
|
23
|
-
|
24
|
-
Install ruby-1.9.x or later, pkg-config.rb and GLib-2.12.x.
|
25
|
-
|
26
|
-
% ruby extconf.rb
|
27
|
-
% make
|
28
|
-
% sudo make install
|
29
|
-
|
30
|
-
Copying
|
31
|
-
-------
|
32
|
-
Copyright (c) 2002-2010 Ruby-GNOME2 Project Team
|
33
|
-
|
34
|
-
This program is free software.
|
35
|
-
You can distribute/modify this program under the terms of
|
36
|
-
the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
|
37
|
-
|
38
|
-
Project Website
|
39
|
-
---------------
|
40
|
-
http://ruby-gnome2.sourceforge.jp/
|