Pull upstream fix for Gio::ApplicationCommandLine

This commit is contained in:
Mamoru TASAKA 2015-10-12 20:36:34 +09:00
commit 54650ef3a9
2 changed files with 67 additions and 6 deletions

View file

@ -0,0 +1,58 @@
From ffe9fec4c2cd83c08cd90b4139bc562c2558e44a Mon Sep 17 00:00:00 2001
From: Kouhei Sutou <kou@clear-code.com>
Date: Mon, 12 Oct 2015 16:56:51 +0900
Subject: [PATCH 13/14] gio2: support Gio::Application.new(:arguments => [...])
GitHub: fix #519
Reported by Mamoru TASAKA. Thanks!!!
---
gio2/lib/gio2/application-command-line.rb | 12 ++++++++++++
gio2/test/test-application-command-line.rb | 6 ++----
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/gio2/lib/gio2/application-command-line.rb b/gio2/lib/gio2/application-command-line.rb
index 97fbb30..c739064 100644
--- a/gio2/lib/gio2/application-command-line.rb
+++ b/gio2/lib/gio2/application-command-line.rb
@@ -16,6 +16,18 @@
module Gio
class ApplicationCommandLine
+ def initialize(properties=nil)
+ if properties
+ arguments = properties[:arguments]
+ if arguments and !arguments.is_a?(GLib::Variant)
+ arguments = GLib::Variant.new(arguments,
+ GLib::VariantType::BYTESTRING_ARRAY)
+ properties = properties.merge(:arguments => arguments)
+ end
+ end
+ super(properties)
+ end
+
alias_method :arguments_raw, :arguments
def arguments
arguments_raw[0]
diff --git a/gio2/test/test-application-command-line.rb b/gio2/test/test-application-command-line.rb
index 441bb81..d699551 100644
--- a/gio2/test/test-application-command-line.rb
+++ b/gio2/test/test-application-command-line.rb
@@ -16,12 +16,10 @@
class TestApplicationCommandLine < Test::Unit::TestCase
include GioTestUtils::Omissions
- def setup
- @command_line = Gio::ApplicationCommandLine.new
- end
test "#arguments" do
omit_on_travis_ci
- assert_equal([], @command_line.arguments)
+ command_line = Gio::ApplicationCommandLine.new(:arguments => ["hello"])
+ assert_equal(["hello"], command_line.arguments)
end
end
--
2.5.0

View file

@ -8,7 +8,7 @@
Summary: Ruby binding of gio-2.0.x
Name: rubygem-%{gem_name}
Version: 3.0.7
Release: 1%{?dist}
Release: 2%{?dist}
Group: Development/Languages
# from README
License: LGPLv2
@ -17,6 +17,9 @@ Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: gio2-%{version}-test-missing-files.tar.gz
# Source1 is generated by the below
Source2: gio2-create-missing-test-files.sh
# https://github.com/ruby-gnome2/ruby-gnome2/issues/591
# https://github.com/ruby-gnome2/ruby-gnome2/commit/ffe9fec4c2cd83c08cd90b4139bc562c2558e44a.patch
Patch1: ruby-gnome2-0013-gio2-support-Gio-Application.new-arguments.patch
Requires: ruby(release)
BuildRequires: ruby(release)
@ -68,6 +71,8 @@ gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%patch1 -p2
# Allow ruby-gnome2 no less than ones
sed -i -e 's|= 3\.0\.7|>= 3.0.7|' %{gem_name}.gemspec
@ -128,11 +133,6 @@ ln -sf /bin/true make
export PATH=$(pwd):$PATH
popd
# omit this for now, already reported on
# https://github.com/ruby-gnome2/ruby-gnome2/issues/591
sed -i test/test-application-command-line.rb \
-e 's|omit_on_travis_ci|omit "issues #591"|'
sed -i test/run-test.rb \
-e '\@exit Test::Unit::AutoRunner@s|,[ \t]*File\.join(.*"test")||'
ruby -rubygems -Ilib:test:ext/%{gem_name} test/run-test.rb
@ -170,6 +170,9 @@ popd
%exclude %{gem_instdir}/test/
%changelog
* Mon Oct 12 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.0.7-2
- Pull upstream fix for Gio::ApplicationCommandLine
* Sun Oct 11 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.0.7-1
- 3.0.7