[packages/ruby-method_source] Up to 1.1.0

arekm arekm at pld-linux.org
Fri Mar 20 16:55:20 CET 2026


commit 2c0b55f02a377f0958f9c1df1954a75115b73f87
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Mar 20 16:55:03 2026 +0100

    Up to 1.1.0

 ruby-3.4-tests.patch    | 11 +++++++++++
 ruby-3.4.patch          | 11 +++++++++++
 ruby-method_source.spec | 38 +++++++++++++++-----------------------
 3 files changed, 37 insertions(+), 23 deletions(-)
---
diff --git a/ruby-method_source.spec b/ruby-method_source.spec
index a09d04f..258fcd6 100644
--- a/ruby-method_source.spec
+++ b/ruby-method_source.spec
@@ -1,48 +1,40 @@
 #
 # Conditional build:
-%bcond_with	tests		# build without tests
+%bcond_without	tests		# build without tests
 
 %define	pkgname	method_source
 Summary:	Retrieve the source code for a method
 Name:		ruby-%{pkgname}
-Version:	0.8.2
-Release:	2
+Version:	1.1.0
+Release:	1
 License:	MIT
 Group:		Development/Languages
 Source0:	http://rubygems.org/downloads/%{pkgname}-%{version}.gem
-# Source0-md5:	106c9cae069647807ba1c795b5b9334c
-URL:		http://banisterfiend.wordpress.com/
+# Source0-md5:	a8553bc1e3941e781683779da71d3896
+Patch0:		ruby-3.4.patch
+Patch1:		ruby-3.4-tests.patch
+URL:		http://github.com/banister/method_source
 BuildRequires:	rpm-rubyprov
-BuildRequires:	rpmbuild(macros) >= 1.656
+BuildRequires:	rpmbuild(macros) >= 1.665
 %if %{with tests}
-BuildRequires:	ruby-bacon < 1.2
-BuildRequires:	ruby-bacon >= 1.1.0
-BuildRequires:	ruby-rake < 1
-BuildRequires:	ruby-rake >= 0.9
+BuildRequires:	rubygem(rspec)
 %endif
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-Retrieve the sourcecode for a method.
-
-%package doc
-Summary:	Documentation for %{name}
-Group:		Documentation
-Requires:	%{name} = %{version}-%{release}
-
-%description doc
-Documentation for %{name}
+Retrieve the source code for a method.
 
 %prep
 %setup -q -n %{pkgname}-%{version}
+%patch -P0 -p1
+%patch -P1 -p1
 
 %build
-# write .gemspec
 %__gem_helper spec
 
 %if %{with tests}
-bacon test/test.rb
+rspec spec
 %endif
 
 %install
@@ -56,7 +48,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README.markdown LICENSE
+%doc LICENSE CHANGELOG.md README.markdown
 %{ruby_vendorlibdir}/method_source.rb
 %{ruby_vendorlibdir}/method_source
-%{ruby_specdir}/method_source-%{version}.gemspec
+%{ruby_specdir}/%{pkgname}-%{version}.gemspec
diff --git a/ruby-3.4-tests.patch b/ruby-3.4-tests.patch
new file mode 100644
index 0000000..d5aa906
--- /dev/null
+++ b/ruby-3.4-tests.patch
@@ -0,0 +1,11 @@
+--- method_source-1.1.0/spec/method_source/code_helpers_spec.rb.orig	2023-12-13 11:45:00.000000000 +0100
++++ method_source-1.1.0/spec/method_source/code_helpers_spec.rb	2026-03-20 15:25:00.000000000 +0100
+@@ -32,7 +32,7 @@
+     ["puts )("],
+     ["1 1"],
+     ["puts :"]
+-  ] + (RbConfig::CONFIG['ruby_install_name'] == 'rbx' ? [] : [
++  ] + ((RbConfig::CONFIG['ruby_install_name'] == 'rbx' || RUBY_VERSION >= '3.4') ? [] : [
+     ["def", "method(1"], # in this case the syntax error is "expecting ')'".
+     ["o = Object.new.tap{ def o.render;","'MEH'", "}"] # in this case the syntax error is "expecting keyword_end".
+   ]).compact.each do |foo|
diff --git a/ruby-3.4.patch b/ruby-3.4.patch
new file mode 100644
index 0000000..691a7f1
--- /dev/null
+++ b/ruby-3.4.patch
@@ -0,0 +1,11 @@
+--- method_source-1.1.0/lib/method_source/code_helpers.rb.orig	2023-12-13 11:45:00.000000000 +0100
++++ method_source-1.1.0/lib/method_source/code_helpers.rb	2026-03-20 15:25:00.000000000 +0100
+@@ -123,7 +123,8 @@
+         /unexpected (\$end|end-of-file|end-of-input|END_OF_FILE)/, # mri, jruby, ruby-2.0, ironruby
+         /embedded document meets end of file/, # =begin
+         /unterminated (quoted string|string|regexp|list) meets end of file/, # "quoted string" is ironruby
++        /unterminated (quoted string|string|regexp|list)/, # ruby 3.4
+         /can't find string ".*" anywhere before EOF/, # rbx and jruby
+         /missing 'end' for/, /expecting kWHEN/ # rbx
+       ]
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ruby-method_source.git/commitdiff/2c0b55f02a377f0958f9c1df1954a75115b73f87



More information about the pld-cvs-commit mailing list