goffice 3.0.9

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 10f507eb2a2ed0cec28fcf2e30e31022ad589dc7
4
+ data.tar.gz: 7fef1d008247a07342c14f303a6ec31231883012
5
+ SHA512:
6
+ metadata.gz: c23a8923c44035699ccd7aaf0e002330ed92edeaf5cb47449b0390ec52d28488d9466ba6ba603dfc71c18359baba6e833aa6edf3d72479bc1cb402c13594ea11
7
+ data.tar.gz: 42c4bcfa8c120c874a7d94079fa101a031072ae672e461c4f03731a7ef35c6bda702dc7b22d5fd14bec2fd54a654c1d09be22f6909c2c11b6b8471ada1af9787
@@ -0,0 +1,78 @@
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/GOFFICE is a Ruby binding of GOFFICE."
24
+ package.description = "Ruby/GOFFICE is a Ruby binding of GOFFICE."
25
+ package.dependency.gem.runtime = ["gsf", "gobject-introspection", "gtk3"]
26
+ package.windows.packages = []
27
+ package.windows.dependencies = []
28
+ package.windows.build_dependencies = [
29
+ "glib2",
30
+ "cairo-gobject",
31
+ "atk",
32
+ "pango",
33
+ "gdk_pixbuf2",
34
+ "gdk3",
35
+ "rsvg2",
36
+ "gsf",
37
+ "gobject-introspection",
38
+ ]
39
+ package.windows.gobject_introspection_dependencies = [
40
+ "gdk3",
41
+ "rsvg2",
42
+ "gsf",
43
+ ]
44
+ # rcairo_windows_binary_base_dir =
45
+ # package.windows_binary_build_task.rcairo_windows_binary_base_dir
46
+ package.external_packages = [
47
+ # {
48
+ # :name => "libxslt",
49
+ # :version => "1.1.28",
50
+ # :download_base_url => "ftp://xmlsoft.org/libxslt",
51
+ # :compression_method => "gz",
52
+ # :windows => {
53
+ # :built_file => "bin/libxslt-1.dll",
54
+ # :configure_args => [
55
+ # "--with-libxml-prefix=#{rcairo_windows_binary_base_dir}",
56
+ # "--without-python",
57
+ # ],
58
+ # :patches => [
59
+ # "libxslt-1.1.28-add-mkdir-fallback.diff",
60
+ # ],
61
+ # },
62
+ # },
63
+ # {
64
+ # :name => "goffice",
65
+ # :download_site => :gnome,
66
+ # :label => "goffice",
67
+ # :version => "0.10.31",
68
+ # :compression_method => "xz",
69
+ # :windows => {
70
+ # :configure_args => [
71
+ # ],
72
+ # :patches => [
73
+ # ],
74
+ # },
75
+ # },
76
+ ]
77
+ end
78
+ package_task.define
@@ -0,0 +1,61 @@
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 "gtk3"
19
+ require "gsf"
20
+
21
+ base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
22
+ vendor_dir = base_dir + "vendor" + "local"
23
+ vendor_bin_dir = vendor_dir + "bin"
24
+ GLib.prepend_dll_path(vendor_bin_dir)
25
+ vendor_girepository_dir = vendor_dir + "lib" + "girepository-1.0"
26
+ GObjectIntrospection.prepend_typelib_path(vendor_girepository_dir)
27
+
28
+ require "goffice/loader"
29
+
30
+ module GOffice
31
+ LOG_DOMAIN = "GOffice"
32
+ GLib::Log.set_log_domain(LOG_DOMAIN)
33
+
34
+ class Error < StandardError
35
+ end
36
+
37
+ class << self
38
+ def const_missing(name)
39
+ init
40
+ if const_defined?(name)
41
+ const_get(name)
42
+ else
43
+ super
44
+ end
45
+ end
46
+
47
+ def init
48
+ class << self
49
+ remove_method(:init)
50
+ remove_method(:const_missing)
51
+ end
52
+ Gtk.init if Gtk.respond_to?(:init)
53
+ loader = Loader.new(self)
54
+ loader.load("GOffice")
55
+ init
56
+ class << self
57
+ remove_method(:init)
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,89 @@
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 GOffice
18
+ class Loader < GObjectIntrospection::Loader
19
+ private
20
+ def pre_load(repository, namespace)
21
+ end
22
+
23
+ def post_load(repository, namespace)
24
+ define_version(repository, namespace)
25
+ require_libraries
26
+ end
27
+
28
+ def define_version(repository, namespace)
29
+ major, minor, micro = repository.get_version(namespace).split(".")
30
+ @base_module.const_set("MAJOR", Integer(major))
31
+ @base_module.const_set("MINOR", Integer(minor))
32
+ micro = Integer(micro) unless micro.nil?
33
+ @base_module.const_set("MICRO", micro)
34
+ end
35
+
36
+ def require_libraries
37
+ require "goffice/version"
38
+ end
39
+
40
+ def load_enum_value(value_info, enum_module)
41
+ name = case value_info.name.upcase
42
+ when /\A30E_360\z/
43
+ "EUR_30_360"
44
+ when /\A30EP_360\z/
45
+ "EP_30_360"
46
+ else
47
+ value_info.name.upcase
48
+ end
49
+ enum_module.const_set(name, value_info.value)
50
+ end
51
+
52
+ def initialize_post(object)
53
+ super
54
+ return unless object.is_a?(GLib::Object)
55
+ self.class.reference_gobject(object, :sink => true)
56
+ end
57
+
58
+ def load_info(info)
59
+ case info.name
60
+ when "_SearchReplace"
61
+ return
62
+ when "gViewAllocation"
63
+ return
64
+ else
65
+ super
66
+ end
67
+ end
68
+
69
+ def rubyish_class_name(info)
70
+ name = info.name.gsub(/Class\z/, "")
71
+ case name
72
+ when /\A3DRotationSel\z/
73
+ "Rotation3DSel"
74
+ when /\Ag(\d*[A-Z]\w*)\z/
75
+ "Graph#{Object::Regexp.last_match[1]}"
76
+ when /\Ac(\d*[A-Z]\w*)\z/
77
+ "Canvas#{Object::Regexp.last_match[1]}"
78
+ when /\Ago_regression_stat_t\z/
79
+ "RegressionStatT"
80
+ when /\Ago_regression_stat_tl\z/
81
+ "RegressionStatTl"
82
+ when /\A\_(.*)\z/
83
+ Object::Regexp.last_match[1]
84
+ else
85
+ name
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,33 @@
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 GOffice
18
+ module Version
19
+ STRING = [MAJOR, MINOR, MICRO].compact.join(".")
20
+
21
+ class << self
22
+ def or_later?(major, minor, micro=nil)
23
+ micro ||= 0
24
+ version = [
25
+ MAJOR,
26
+ MINOR,
27
+ MICRO,
28
+ ].compact
29
+ (version <=> [major, minor, micro]) >= 0
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,23 @@
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 "test-unit"
18
+
19
+ module GOfficeTestUtils
20
+ def omit_on_travis_ci
21
+ omit("This test can't be run on Travis CI") if ENV["CI"]
22
+ end
23
+ end
@@ -0,0 +1,62 @@
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
+ glib_base = File.join(ruby_gnome2_base, "glib2")
23
+ atk_base = File.join(ruby_gnome2_base, "atk")
24
+ pango_base = File.join(ruby_gnome2_base, "pango")
25
+ gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2")
26
+ cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject")
27
+ gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
28
+ gio2_base = File.join(ruby_gnome2_base, "gio2")
29
+ gdk3_base = File.join(ruby_gnome2_base, "gdk3")
30
+ gsf_base = File.join(ruby_gnome2_base, "gsf")
31
+ gtk3_base = File.join(ruby_gnome2_base, "gtk3")
32
+ goffice_base = File.join(ruby_gnome2_base, "goffice")
33
+
34
+ modules = [
35
+ [glib_base, "glib2"],
36
+ [atk_base, "atk"],
37
+ [pango_base, "pango"],
38
+ [cairo_gobject_base, "cairo-gobject"],
39
+ [gdk_pixbuf_base, "gdk_pixbuf2"],
40
+ [gobject_introspection_base, "gobject-introspection"],
41
+ [gio2_base, "gio2"],
42
+ [gdk3_base, "gdk3"],
43
+ [gtk3_base, "gtk3"],
44
+ [gsf_base, "gsf"],
45
+ [goffice_base, "goffice"]
46
+ ]
47
+
48
+ modules.each do |target, module_name|
49
+ makefile = File.join(target, "Makefile")
50
+ if File.exist?(makefile) and system("which make > /dev/null")
51
+ `make -C #{target.dump} > /dev/null` or exit(false)
52
+ end
53
+ $LOAD_PATH.unshift(File.join(target, "ext", module_name))
54
+ $LOAD_PATH.unshift(File.join(target, "lib"))
55
+ end
56
+
57
+ $LOAD_PATH.unshift(File.join(goffice_base, "test"))
58
+ require "goffice-test-utils"
59
+
60
+ require "goffice"
61
+
62
+ exit Test::Unit::AutoRunner.run(true, File.join(goffice_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 DataScalarStrTest < Test::Unit::TestCase
18
+ include GOfficeTestUtils
19
+
20
+ test ".new" do
21
+ omit_on_travis_ci
22
+ data = GOffice::DataScalarStr.new("XXX")
23
+ assert_equal("XXX", data.str)
24
+ end
25
+ end
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: goffice
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: gsf
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
+ - !ruby/object:Gem::Dependency
42
+ name: gtk3
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 3.0.9
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 3.0.9
55
+ description: Ruby/GOFFICE is a Ruby binding of GOFFICE.
56
+ email: ruby-gnome2-devel-en@lists.sourceforge.net
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - Rakefile
62
+ - lib/goffice.rb
63
+ - lib/goffice/loader.rb
64
+ - lib/goffice/version.rb
65
+ - test/goffice-test-utils.rb
66
+ - test/run-test.rb
67
+ - test/test-data-scalar-str.rb
68
+ homepage: http://ruby-gnome2.sourceforge.jp/
69
+ licenses:
70
+ - LGPLv2.1+
71
+ metadata: {}
72
+ post_install_message:
73
+ rdoc_options: []
74
+ require_paths:
75
+ - lib
76
+ required_ruby_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: 2.1.0
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ requirements: []
87
+ rubyforge_project:
88
+ rubygems_version: 2.5.1
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Ruby/GOFFICE is a Ruby binding of GOFFICE.
92
+ test_files: []