gobject-introspection 3.0.2 → 3.0.3

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: 43fb9034b06bbabd0681a877e2bdad9ee92ecd44
4
- data.tar.gz: cc096dc7cefc3c80b9b55bb615aca413aca24b07
3
+ metadata.gz: 206036a67c1ca414e9aa5fa25286c7e5715be99d
4
+ data.tar.gz: bd711041529b767dc5bb0760d4101647141905ae
5
5
  SHA512:
6
- metadata.gz: efce6549fc4ec94824e903654200252ff5a805528e35e9a5a7befbf1c3940a13aa748538e6be53049fd3548ed4de9036b0cb09c6d6b7f80b40796d493ba231ee
7
- data.tar.gz: 929fa23d59f2b783779911a1783e3e0416804a87497dbb2e32ed800e5ab176917869d070daae7fa09f3dd6bcdb48c0f7851c96134b6352eba514645a9f7cdc42
6
+ metadata.gz: 93ea8cb9b1b711af9653ee4057d8ed68aa251cdad7a7bca25e16b93074dcc2e5a0ca0c1879d6a26ecd7229014d21adf11033c89b9d9584690169f291dddc7ad0
7
+ data.tar.gz: cb2865c866ef95e4cea42afe3ff57c81ef828acec9b14a1b8cee0e1171807f92360bc3d2ec3c11d515f14f91f59c0c5b41e2be900ee2562efc4a1256be380ca1
@@ -46,6 +46,19 @@ rg_s_default(G_GNUC_UNUSED VALUE klass)
46
46
  return GOBJ2RVAL(g_irepository_get_default());
47
47
  }
48
48
 
49
+ static VALUE
50
+ rg_s_prepend_search_path(VALUE klass, VALUE rb_path)
51
+ {
52
+ g_irepository_prepend_search_path(RVAL2CSTR(rb_path));
53
+ return klass;
54
+ }
55
+
56
+ static VALUE
57
+ rg_s_search_path(G_GNUC_UNUSED VALUE klass)
58
+ {
59
+ return FILENAMEGSLIST2RVAL(g_irepository_get_search_path());
60
+ }
61
+
49
62
 
50
63
  /* Force the namespace to be loaded if it isn't already. If namespace is not
51
64
  * loaded, this function will search for a ".typelib" file using the repository
@@ -101,6 +114,10 @@ rg_get_dependencies(VALUE self, VALUE rb_namespace)
101
114
  repository = SELF(self);
102
115
  namespace_ = RVAL2CSTR(rb_namespace);
103
116
  dependencies = g_irepository_get_dependencies(repository, namespace_);
117
+ if (!dependencies) {
118
+ return Qnil;
119
+ }
120
+
104
121
  rb_dependencies = rb_ary_new();
105
122
  for (i = 0; dependencies[i]; i++) {
106
123
  rb_ary_push(rb_dependencies, CSTR2RVAL(dependencies[i]));
@@ -234,6 +251,8 @@ rb_gi_repository_init(VALUE rb_mGI)
234
251
  RG_TARGET_NAMESPACE = G_DEF_CLASS(G_TYPE_IREPOSITORY, "Repository", rb_mGI);
235
252
 
236
253
  RG_DEF_SMETHOD(default, 0);
254
+ RG_DEF_SMETHOD(prepend_search_path, 1);
255
+ RG_DEF_SMETHOD(search_path, 0);
237
256
  RG_DEF_METHOD(require, -1);
238
257
  RG_DEF_METHOD(get_dependencies, 1);
239
258
  RG_DEF_METHOD(loaded_namespaces, 0);
@@ -19,7 +19,14 @@ require "glib2"
19
19
  module GObjectIntrospection
20
20
  class << self
21
21
  def prepend_typelib_path(path)
22
- GLib.prepend_path_to_environment_variable(path, "GI_TYPELIB_PATH")
22
+ path = Pathname(path) unless path.is_a?(Pathname)
23
+ return unless path.exist?
24
+
25
+ dir = path.to_s
26
+ dir = dir.gsub("/", File::ALT_SEPARATOR) if File::ALT_SEPARATOR
27
+ return if Repository.search_path.include?(dir)
28
+
29
+ Repository.prepend_search_path(dir)
23
30
  end
24
31
  end
25
32
  end
@@ -15,7 +15,6 @@
15
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
  require "test-unit"
18
- require "test/unit/notify"
19
18
 
20
19
  module GObjectIntrospectionTestUtils
21
20
  def require_version(major, minor, micro)
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2014 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2012-2015 Ruby-GNOME2 Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -23,6 +23,13 @@ class TestRepository < Test::Unit::TestCase
23
23
  @repository.require("Gio")
24
24
  end
25
25
 
26
+ def test_search_path
27
+ path = GObjectIntrospection::Repository.search_path
28
+ GObjectIntrospection::Repository.prepend_search_path(__dir__)
29
+ assert_equal([__dir__] + path,
30
+ GObjectIntrospection::Repository.search_path)
31
+ end
32
+
26
33
  def test_get_n_infos
27
34
  assert_kind_of(Integer, @repository.get_n_infos("GObject"))
28
35
  end
@@ -34,8 +41,8 @@ class TestRepository < Test::Unit::TestCase
34
41
 
35
42
  def test_get_dependencies
36
43
  require_version(1, 36, 0)
37
- assert_equal(["GObject-2.0"].sort,
38
- @repository.get_dependencies("Gio").sort)
44
+ assert_equal(["GLib-2.0"].sort,
45
+ @repository.get_dependencies("GObject").sort)
39
46
  end
40
47
 
41
48
  def test_loaded_namespaces
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobject-introspection
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
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-09-13 00:00:00.000000000 Z
11
+ date: 2015-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glib2
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.2
19
+ version: 3.0.3
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.0.2
26
+ version: 3.0.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: test-unit
29
29
  requirement: !ruby/object:Gem::Requirement