gsf 3.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2fc32031150a2966e3438c222edfd89ea382c332
4
+ data.tar.gz: 395a88db1c65d6308b0b8ed195098d30b3f430a7
5
+ SHA512:
6
+ metadata.gz: d0b381c4112e873d0cbb758c30e1b0c92d42ead7d43ad2401c793143a603aa31308e9a9fb45ce751c50dfdc773fb79fb7773dcfc4de1f78ad540b9f5ccb73e7b
7
+ data.tar.gz: 60150d559d53afb25d58bca6d113ebf84037538a7d18d75b8cf2a04956155d874ec52d72e5ef97b42f11ffd3df9ba98b5203f3f52a254424a2283f155eb7bca8
data/Rakefile ADDED
@@ -0,0 +1,55 @@
1
+ # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2016 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
+ $LOAD_PATH.unshift("./../glib2/lib")
20
+ require 'gnome2/rake/package-task'
21
+
22
+ package_task = GNOME2::Rake::PackageTask.new do |package|
23
+ package.summary = "Ruby/GSF is a Ruby binding of GSF."
24
+ package.description = "Ruby/GSF is a Ruby binding of GSF."
25
+ package.dependency.gem.runtime = ["gio2", "gobject-introspection"]
26
+ package.windows.packages = []
27
+ package.windows.dependencies = ["libxml2"]
28
+ package.windows.build_dependencies = [
29
+ "glib2",
30
+ "gio2",
31
+ "cairo-gobject",
32
+ "gobject-introspection",
33
+ ]
34
+ package.windows.gobject_introspection_dependencies = [
35
+ "gio2",
36
+ "cairo-gobject",
37
+ ]
38
+ package.external_packages = [
39
+ {
40
+ :name => "libgsf",
41
+ :download_site => :gnome,
42
+ :label => "gsf",
43
+ :version => "1.14.39",
44
+ :compression_method => "xz",
45
+ :windows => {
46
+ :configure_args => [
47
+ ],
48
+ :patches => [
49
+ ],
50
+ :built_file => "bin/libgsf-win32-1-114.dll",
51
+ },
52
+ },
53
+ ]
54
+ end
55
+ package_task.define
data/lib/gsf.rb ADDED
@@ -0,0 +1,53 @@
1
+ # Copyright (C) 2016 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 "gobject-introspection"
18
+ require "gio2"
19
+
20
+ base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
21
+ vendor_dir = base_dir + "vendor" + "local"
22
+ vendor_bin_dir = vendor_dir + "bin"
23
+ GLib.prepend_dll_path(vendor_bin_dir)
24
+ vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
25
+ GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
26
+
27
+ require "gsf/loader"
28
+
29
+ module Gsf
30
+ LOG_DOMAIN = "Gsf"
31
+ GLib::Log.set_log_domain(LOG_DOMAIN)
32
+
33
+ class << self
34
+ def const_missing(name)
35
+ init
36
+ if const_defined?(name)
37
+ const_get(name)
38
+ else
39
+ super
40
+ end
41
+ end
42
+
43
+ def init
44
+ class << self
45
+ remove_method(:init)
46
+ remove_method(:const_missing)
47
+ end
48
+ Gio.init if Gio.respond_to?(:init)
49
+ loader = Loader.new(self)
50
+ loader.load("Gsf")
51
+ end
52
+ end
53
+ end
data/lib/gsf/input.rb ADDED
@@ -0,0 +1,26 @@
1
+ # Copyright (C) 2016 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 Gsf
18
+ class Input
19
+ alias_method :read_raw, :read
20
+ def read(size=nil)
21
+ size ||= remaining
22
+ bytes = read_raw(size)
23
+ bytes.pack("C*")
24
+ end
25
+ end
26
+ end
data/lib/gsf/loader.rb ADDED
@@ -0,0 +1,57 @@
1
+ # Copyright (C) 2016 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 Gsf
18
+ class Loader < GObjectIntrospection::Loader
19
+ private
20
+ def load_function_info(info)
21
+ name = info.name
22
+ case name
23
+ when "init"
24
+ # ignore
25
+ else
26
+ super
27
+ end
28
+ end
29
+
30
+ def load_enum_value(value_info, enum_module)
31
+ # TODO: Add constant name rename feature to
32
+ # gobject-introspection and use it.
33
+ if value_info.name == "2nd"
34
+ enum_module.const_set("SECOND", value_info.value)
35
+ else
36
+ super
37
+ end
38
+ end
39
+
40
+ def pre_load(repository, namespace)
41
+ end
42
+
43
+ def post_load(repository, namespace)
44
+ require_libraries
45
+ end
46
+
47
+ def require_libraries
48
+ require "gsf/input"
49
+ end
50
+
51
+ def initialize_post(object)
52
+ super
53
+ return unless object.is_a?(GLib::Object)
54
+ self.class.reference_gobject(object, :sink => true)
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,22 @@
1
+ # Copyright (C) 2016 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 "tempfile"
18
+
19
+ require "test-unit"
20
+
21
+ module GsfTestUtils
22
+ end
data/test/run-test.rb ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2016 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
+ gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
23
+ gio2_base = File.join(ruby_gnome2_base, "gio2")
24
+ gsf_base = File.join(ruby_gnome2_base, "gsf")
25
+
26
+ modules = [
27
+ [gobject_introspection_base, "gobject-introspection"],
28
+ [gio2_base, "gio2"],
29
+ [gsf_base, "gsf"]
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(gsf_base, "test"))
42
+ require "gsf-test-utils"
43
+
44
+ require "gsf"
45
+
46
+ exit Test::Unit::AutoRunner.run(true, File.join(gsf_base, "test"))
@@ -0,0 +1,25 @@
1
+ # Copyright (C) 2016 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 InputStdioTest < Test::Unit::TestCase
18
+ test ".new" do
19
+ file = Tempfile.new("test-input-stdio")
20
+ file.write("hello")
21
+ file.close
22
+ input = Gsf::InputStdio.new(file.path)
23
+ assert_equal("hello", input.read)
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gsf
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.9
5
+ platform: ruby
6
+ authors:
7
+ - The Ruby-GNOME2 Project Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: gio2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.9
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.9
27
+ - !ruby/object:Gem::Dependency
28
+ name: gobject-introspection
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 3.0.9
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.0.9
41
+ description: Ruby/GSF is a Ruby binding of GSF.
42
+ email: ruby-gnome2-devel-en@lists.sourceforge.net
43
+ executables: []
44
+ extensions: []
45
+ extra_rdoc_files: []
46
+ files:
47
+ - Rakefile
48
+ - lib/gsf.rb
49
+ - lib/gsf/input.rb
50
+ - lib/gsf/loader.rb
51
+ - test/gsf-test-utils.rb
52
+ - test/run-test.rb
53
+ - test/test-input-stdio.rb
54
+ homepage: http://ruby-gnome2.sourceforge.jp/
55
+ licenses:
56
+ - LGPLv2.1+
57
+ metadata: {}
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 2.1.0
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubyforge_project:
74
+ rubygems_version: 2.5.1
75
+ signing_key:
76
+ specification_version: 4
77
+ summary: Ruby/GSF is a Ruby binding of GSF.
78
+ test_files: []