gio2 2.2.4-x64-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +31 -0
  3. data/ext/gio2/depend +6 -0
  4. data/ext/gio2/extconf.rb +77 -0
  5. data/ext/gio2/rb-gio2-pollable-source.c +59 -0
  6. data/ext/gio2/rb-gio2.c +32 -0
  7. data/ext/gio2/rb-gio2.h +26 -0
  8. data/extconf.rb +65 -0
  9. data/lib/2.0/gio2.so +0 -0
  10. data/lib/2.1/gio2.so +0 -0
  11. data/lib/2.2/gio2.so +0 -0
  12. data/lib/gio2.rb +56 -0
  13. data/lib/gio2/deprecated.rb +118 -0
  14. data/lib/gio2/inet-address.rb +33 -0
  15. data/lib/gio2/input-stream.rb +48 -0
  16. data/lib/gio2/loader.rb +240 -0
  17. data/lib/gio2/pollable-input-stream.rb +60 -0
  18. data/lib/gio2/pollable-output-stream.rb +27 -0
  19. data/lib/gio2/resources.rb +62 -0
  20. data/test/fixture/content-type/x-content/unix-software/autorun.sh +1 -0
  21. data/test/fixture/resource/Rakefile +32 -0
  22. data/test/fixture/resource/logo.png +0 -0
  23. data/test/fixture/resource/ruby-gio2.gresource +0 -0
  24. data/test/fixture/resource/ruby-gio2.gresource.xml +6 -0
  25. data/test/gio2-test-utils.rb +22 -0
  26. data/test/gio2-test-utils/fixture.rb +24 -0
  27. data/test/gio2-test-utils/omissions.rb +23 -0
  28. data/test/gio2-test-utils/socket-client.rb +59 -0
  29. data/test/run-test.rb +51 -0
  30. data/test/test-buffered-input-stream.rb +23 -0
  31. data/test/test-charset-converter.rb +23 -0
  32. data/test/test-content-type.rb +39 -0
  33. data/test/test-data-input-stream.rb +21 -0
  34. data/test/test-dbus.rb +42 -0
  35. data/test/test-file-enumerator.rb +26 -0
  36. data/test/test-file-monitor.rb +33 -0
  37. data/test/test-file.rb +30 -0
  38. data/test/test-inet-address.rb +34 -0
  39. data/test/test-input-stream.rb +36 -0
  40. data/test/test-memory-input-stream.rb +23 -0
  41. data/test/test-memory-output-stream.rb +23 -0
  42. data/test/test-output-stream.rb +39 -0
  43. data/test/test-pollable-input-stream.rb +54 -0
  44. data/test/test-pollable-output-stream.rb +53 -0
  45. data/test/test-resources.rb +58 -0
  46. metadata +115 -0
@@ -0,0 +1,32 @@
1
+ # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2014 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
+ gresource = "ruby-gio2.gresource"
22
+ gresource_xml = "#{gresource}.xml"
23
+ contents = ["logo.png"]
24
+
25
+ dependencies = contents + [gresource_xml]
26
+
27
+ CLEAN << gresource
28
+ file gresource => dependencies do
29
+ sh("glib-compile-resources", gresource_xml)
30
+ end
31
+
32
+ task :default => gresource
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <gresources>
3
+ <gresource prefix="/org/ruby-gnome2/test">
4
+ <file>logo.png</file>
5
+ </gresource>
6
+ </gresources>
@@ -0,0 +1,22 @@
1
+ # Copyright (C) 2013 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
+ require "test-unit"
18
+ require "test/unit/notify"
19
+
20
+ require "gio2-test-utils/fixture"
21
+ require "gio2-test-utils/omissions"
22
+ require "gio2-test-utils/socket-client"
@@ -0,0 +1,24 @@
1
+ # Copyright (C) 2013 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 GioTestUtils
18
+ module Fixture
19
+ def fixture_path(*components)
20
+ base_dir = File.join(File.dirname(__FILE__), "..", "fixture")
21
+ File.expand_path(File.join(base_dir, *components))
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,23 @@
1
+ # Copyright (C) 2014 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 GioTestUtils
18
+ module Omissions
19
+ def omit_on_os_x
20
+ omit("Skip this test on OS X") if RUBY_PLATFORM =~ /darwin/
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,59 @@
1
+ # Copyright (C) 2014 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
+ require "socket"
18
+
19
+ module GioTestUtils
20
+ module SocketClient
21
+ def setup_socket_client
22
+ setup_server
23
+ setup_client
24
+ setup_loop
25
+ end
26
+
27
+ def teardown_socket_client
28
+ teardown_loop
29
+ teardown_client
30
+ teardown_server
31
+ end
32
+
33
+ def setup_server
34
+ @host = "127.0.0.1"
35
+ @server = TCPServer.new(@host, 0)
36
+ @port = @server.addr[1]
37
+ end
38
+
39
+ def teardown_server
40
+ @server.close
41
+ end
42
+
43
+ def setup_client
44
+ @client = Gio::SocketClient.new
45
+ @connection = @client.connect_to_host(@host, @port)
46
+ end
47
+
48
+ def teardown_client
49
+ @connection.close
50
+ end
51
+
52
+ def setup_loop
53
+ @loop = GLib::MainLoop.new
54
+ end
55
+
56
+ def teardown_loop
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2013-2014 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
+ ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
20
+ ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
21
+
22
+ glib_base = File.join(ruby_gnome2_base, "glib2")
23
+ gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
24
+ gio2_base = File.join(ruby_gnome2_base, "gio2")
25
+
26
+ modules = [
27
+ [glib_base, "glib2"],
28
+ [gobject_introspection_base, "gobject-introspection"],
29
+ [gio2_base, "gio2"],
30
+ ]
31
+
32
+ modules.each do |target, module_name|
33
+ makefile = File.join(target, "Makefile")
34
+ if File.exist?(makefile) and system("which make > /dev/null")
35
+ `make -C #{target.dump} > /dev/null` or exit(false)
36
+ end
37
+ $LOAD_PATH.unshift(File.join(target, "ext", module_name))
38
+ $LOAD_PATH.unshift(File.join(target, "lib"))
39
+ end
40
+
41
+ $LOAD_PATH.unshift(File.join(glib_base, "test"))
42
+ require "glib-test-init"
43
+
44
+ $VERBOSE = false # TODO: remove me
45
+
46
+ $LOAD_PATH.unshift(File.join(gio2_base, "test"))
47
+ require "gio2-test-utils"
48
+
49
+ require "gio2"
50
+
51
+ exit Test::Unit::AutoRunner.run(true)
@@ -0,0 +1,23 @@
1
+ # Copyright (C) 2013 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 TestBufferedInputStream < Test::Unit::TestCase
18
+ def test_buffered_input_stream
19
+ assert_nothing_raised do
20
+ Gio::BufferedInputStream.new(Gio::FileInputStream.new)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # Copyright (C) 2013 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 TestCharsetConverter < Test::Unit::TestCase
18
+ def test_converter
19
+ assert_nothing_raised do
20
+ Gio::CharsetConverter.new("UTF-8", "ASCII")
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,39 @@
1
+ # Copyright (C) 2014 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 TestContentType < Test::Unit::TestCase
18
+ include GioTestUtils::Omissions
19
+
20
+ def setup
21
+ @content_type = Gio::ContentType.new("image/jpeg")
22
+ end
23
+
24
+ def test_icon
25
+ assert_equal("image-jpeg",
26
+ @content_type.icon.names.first)
27
+ end
28
+
29
+ def test_guess
30
+ omit_on_os_x
31
+ assert_equal(["audio/mpeg", false],
32
+ Gio::ContentType.guess("filename.mp3"))
33
+ end
34
+
35
+ def test_executable
36
+ content_type = Gio::ContentType.new("application/x-executable")
37
+ assert_true(content_type.executable?)
38
+ end
39
+ end
@@ -0,0 +1,21 @@
1
+ # Copyright (C) 2013 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 TestDataInputStream < Test::Unit::TestCase
18
+ def test_byte_order_property
19
+ assert_equal Gio::DataStreamByteOrder::BIG_ENDIAN, Gio::DataInputStream.new(Gio::MemoryInputStream.new).byte_order
20
+ end
21
+ end
@@ -0,0 +1,42 @@
1
+ # Copyright (C) 2014 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 TestDBus < Test::Unit::TestCase
18
+ def test_dbus_guid
19
+ guid = Gio::DBus.generate_guid
20
+ assert_true(Gio::DBus.guid?(guid))
21
+ end
22
+
23
+ def test_dbus_name
24
+ name = "org.freedesktop.DBus"
25
+ assert_true(Gio::DBus.name?(name))
26
+ end
27
+
28
+ def test_dbus_unique_name
29
+ name = ":org.freedesktop.DBus"
30
+ assert_true(Gio::DBus.unique_name?(name))
31
+ end
32
+
33
+ def test_dbus_interface_name
34
+ name = "org.freedesktop.DBus"
35
+ assert_true(Gio::DBus.interface_name?(name))
36
+ end
37
+
38
+ def test_dbus_member_name
39
+ member = "StartServiceByName"
40
+ assert_true(Gio::DBus.member_name?(member))
41
+ end
42
+ end
@@ -0,0 +1,26 @@
1
+ # Copyright (C) 2013-2014 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 TestFileEnumerator < Test::Unit::TestCase
18
+ include GioTestUtils::Fixture
19
+
20
+ def test_container
21
+ path = File.dirname(__FILE__)
22
+ dir = Gio::File.path(path)
23
+ enumerator = dir.enumerate_children("*", :none)
24
+ assert_equal(path, enumerator.container.path)
25
+ end
26
+ end
@@ -0,0 +1,33 @@
1
+ # Copyright (C) 2013 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 TestFileMonitor < Test::Unit::TestCase
18
+ class Flags < self
19
+ def test_file_monitor_flags
20
+ assert_nothing_raised do
21
+ Gio::FileMonitorFlags.new(Gio::FileMonitorFlags::SEND_MOVED)
22
+ end
23
+ end
24
+ end
25
+
26
+ class Event < self
27
+ def test_file_monitor_event
28
+ assert_nothing_raised do
29
+ Gio::FileMonitorEvent.new(Gio::FileMonitorEvent::CHANGED)
30
+ end
31
+ end
32
+ end
33
+ end