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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 206036a67c1ca414e9aa5fa25286c7e5715be99d
|
4
|
+
data.tar.gz: bd711041529b767dc5bb0760d4101647141905ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/test/test-repository.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
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(["
|
38
|
-
@repository.get_dependencies("
|
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.
|
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-
|
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.
|
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.
|
26
|
+
version: 3.0.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: test-unit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|