glib2 2.2.3 → 2.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +44 -19
- data/ext/glib2/extconf.rb +1 -1
- data/ext/glib2/glib-enum-types.c +1233 -0
- data/ext/glib2/glib-enum-types.h +154 -0
- data/ext/glib2/rbglib.c +2 -2
- data/ext/glib2/rbglib.h +1 -1
- data/ext/glib2/rbglib2conversions.h +2 -0
- data/ext/glib2/rbglib_fileutils.c +25 -0
- data/ext/glib2/rbglib_source.c +50 -2
- data/ext/glib2/rbglib_threads.c +1 -1
- data/ext/glib2/rbglib_utils.c +8 -3
- data/ext/glib2/rbgobj_convert.c +12 -9
- data/lib/glib2/deprecatable.rb +25 -21
- data/lib/gnome2/rake/native-binary-build-task.rb +4 -2
- data/lib/gnome2/rake/package-task.rb +31 -30
- data/lib/gnome2/rake/package.rb +9 -0
- data/lib/gnome2/rake/{win32-binary-build-task.rb → windows-binary-build-task.rb} +26 -24
- data/lib/gnome2/rake/{win32-binary-download-task.rb → windows-binary-download-task.rb} +20 -14
- data/lib/mkmf-gnome2.rb +27 -3
- data/test/test_file_utils.rb +38 -0
- data/test/test_source.rb +37 -3
- metadata +6 -4
data/test/test_file_utils.rb
CHANGED
@@ -12,4 +12,42 @@ class TestGLibFileUtils < Test::Unit::TestCase
|
|
12
12
|
assert_equal("1.5 MB", GLib.format_size_for_display(1024 * 1024 * 1.5))
|
13
13
|
assert_equal("1.0 GB", GLib.format_size_for_display(1024 * 1024 * 1024))
|
14
14
|
end
|
15
|
+
|
16
|
+
sub_test_case "#format_size" do
|
17
|
+
def setup
|
18
|
+
only_glib_version(2, 30, 0)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_kb
|
22
|
+
assert_equal("1.0 kB", GLib.format_size(1000))
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_mb
|
26
|
+
assert_equal("1.0 MB", GLib.format_size(1000 * 1000))
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_gb
|
30
|
+
assert_equal("1.0 GB", GLib.format_size(1000 * 1000 * 1000))
|
31
|
+
end
|
32
|
+
|
33
|
+
sub_test_case "flags" do
|
34
|
+
sub_test_case ":iec_units" do
|
35
|
+
def format_size(size)
|
36
|
+
GLib.format_size(size, :flags => :iec_units)
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_kib
|
40
|
+
assert_equal("1.0 KiB", format_size(1024))
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_mib
|
44
|
+
assert_equal("1.0 MiB", format_size(1024 * 1024))
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_gib
|
48
|
+
assert_equal("1.0 GiB", format_size(1024 * 1024 * 1024))
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
15
53
|
end
|
data/test/test_source.rb
CHANGED
@@ -22,8 +22,42 @@ class TestGLibSource < Test::Unit::TestCase
|
|
22
22
|
def test_time
|
23
23
|
context = GLib::MainContext.default
|
24
24
|
source = GLib::Idle.source_new
|
25
|
-
source.attach(context)
|
26
|
-
|
27
|
-
|
25
|
+
id = source.attach(context)
|
26
|
+
begin
|
27
|
+
time = source.time
|
28
|
+
assert_operator(0, :<, time)
|
29
|
+
ensure
|
30
|
+
GLib::Source.remove(id)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_destroy
|
35
|
+
context = GLib::MainContext.new
|
36
|
+
source = GLib::Idle.source_new
|
37
|
+
id = source.attach(context)
|
38
|
+
assert_not_nil(context.find_source(id))
|
39
|
+
source.destroy
|
40
|
+
assert_nil(context.find_source(id))
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_name
|
44
|
+
only_glib_version(2, 26, 0)
|
45
|
+
|
46
|
+
source = GLib::Idle.source_new
|
47
|
+
assert_nil(source.name)
|
48
|
+
|
49
|
+
source_name = "glib source"
|
50
|
+
source.name = source_name
|
51
|
+
assert_equal(source_name, source.name)
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_ready_time
|
55
|
+
only_glib_version(2, 36, 0)
|
56
|
+
|
57
|
+
source = GLib::Idle.source_new
|
58
|
+
|
59
|
+
ready_time = 5
|
60
|
+
source.ready_time = 5
|
61
|
+
assert_equal(ready_time, source.ready_time)
|
28
62
|
end
|
29
63
|
end
|
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: 2.2.
|
4
|
+
version: 2.2.4
|
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: 2014-
|
11
|
+
date: 2014-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pkg-config
|
@@ -49,6 +49,8 @@ files:
|
|
49
49
|
- Rakefile
|
50
50
|
- ext/glib2/depend
|
51
51
|
- ext/glib2/extconf.rb
|
52
|
+
- ext/glib2/glib-enum-types.c
|
53
|
+
- ext/glib2/glib-enum-types.h
|
52
54
|
- ext/glib2/glib2.def
|
53
55
|
- ext/glib2/rbgcompat.h
|
54
56
|
- ext/glib2/rbglib.c
|
@@ -125,8 +127,8 @@ files:
|
|
125
127
|
- lib/gnome2/rake/package-task.rb
|
126
128
|
- lib/gnome2/rake/package.rb
|
127
129
|
- lib/gnome2/rake/source-download-task.rb
|
128
|
-
- lib/gnome2/rake/
|
129
|
-
- lib/gnome2/rake/
|
130
|
+
- lib/gnome2/rake/windows-binary-build-task.rb
|
131
|
+
- lib/gnome2/rake/windows-binary-download-task.rb
|
130
132
|
- lib/mkmf-gnome2.rb
|
131
133
|
- sample/bookmarkfile.rb
|
132
134
|
- sample/idle.rb
|