From bd0cbf2798672d9dc805e0f44b7c55bdd47119ec Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 30 Oct 2020 21:03:55 +0100 Subject: [PATCH] Update to method_source 1.0.0 also enhance .spec and .gitignore files. Resolves: rhbz#1495844 --- .gitignore | 5 +- ...8.2-fix-fixnum-bignum-warnings-tests.patch | 13 ----- ...rce-0.8.2-fix-fixnum-bignum-warnings.patch | 52 ------------------- rubygem-method_source.spec | 33 +++++------- sources | 2 +- 5 files changed, 16 insertions(+), 89 deletions(-) delete mode 100644 rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings-tests.patch delete mode 100644 rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings.patch diff --git a/.gitignore b/.gitignore index 3366349..cd5561a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1 @@ -/method_source-0.7.1.gem -/method_source-0.8.gem -/method_source-0.8.1.gem -/method_source-0.8.2.gem +/method_source-*.gem diff --git a/rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings-tests.patch b/rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings-tests.patch deleted file mode 100644 index 174d80c..0000000 --- a/rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings-tests.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/test/test.rb b/test/test.rb -index 4743a50..b99f717 100644 ---- a/test/test.rb -+++ b/test/test.rb -@@ -13,7 +13,7 @@ - end - - it 'should not raise for immediate instance methods' do -- [Symbol, Fixnum, TrueClass, FalseClass, NilClass].each do |immediate_class| -+ [Symbol, Integer, TrueClass, FalseClass, NilClass].each do |immediate_class| - lambda { immediate_class.instance_method(:to_s).source_location }.should.not.raise - end - end diff --git a/rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings.patch b/rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings.patch deleted file mode 100644 index de77fd6..0000000 --- a/rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings.patch +++ /dev/null @@ -1,52 +0,0 @@ -diff --git a/lib/method_source/code_helpers.rb b/lib/method_source/code_helpers.rb -index 6c1d53e..9d9da55 100644 ---- a/lib/method_source/code_helpers.rb -+++ b/lib/method_source/code_helpers.rb -@@ -6,14 +6,14 @@ module CodeHelpers - # This is useful to get module or method source code. - # - # @param [Array, File, String] file The file to parse, either as a File or as -- # @param [Fixnum] line_number The line number at which to look. -+ # @param [Integer] line_number The line number at which to look. - # NOTE: The first line in a file is - # line 1! - # @param [Hash] options The optional configuration parameters. - # @option options [Boolean] :strict If set to true, then only completely - # valid expressions are returned. Otherwise heuristics are used to extract - # expressions that may have been valid inside an eval. -- # @option options [Fixnum] :consume A number of lines to automatically -+ # @option options [Integer] :consume A number of lines to automatically - # consume (add to the expression buffer) without checking for validity. - # @return [String] The first complete expression - # @raise [SyntaxError] If the first complete expression can't be identified -@@ -46,7 +46,7 @@ def expression_at(file, line_number, options={}) - # - # @param [Array, File, String] file The file to parse, either as a File or as - # a String or an Array of lines. -- # @param [Fixnum] line_number The line number at which to look. -+ # @param [Integer] line_number The line number at which to look. - # NOTE: The first line in a file is line 1! - # @return [String] The comment - def comment_describing(file, line_number) -@@ -84,7 +84,7 @@ def complete_expression?(str) - # Get the first expression from the input. - # - # @param [Array] lines -- # @param [Fixnum] consume A number of lines to automatically -+ # @param [Integer] consume A number of lines to automatically - # consume (add to the expression buffer) without checking for validity. - # @yield a clean-up function to run before checking for complete_expression - # @return [String] a valid ruby expression -diff --git a/lib/method_source/source_location.rb b/lib/method_source/source_location.rb -index 1e2a22a..7629869 100644 ---- a/lib/method_source/source_location.rb -+++ b/lib/method_source/source_location.rb -@@ -111,7 +111,7 @@ def source_location - case - when klass == Symbol - return :a.method(name).source_location -- when klass == Fixnum -+ when klass == Integer - return 0.method(name).source_location - when klass == TrueClass - return true.method(name).source_location diff --git a/rubygem-method_source.spec b/rubygem-method_source.spec index f4384f9..052a177 100644 --- a/rubygem-method_source.spec +++ b/rubygem-method_source.spec @@ -3,21 +3,16 @@ Summary: Retrieve the source code for a method Name: rubygem-%{gem_name} -Version: 0.8.2 -Release: 12%{?dist} +Version: 1.0.0 +Release: 1%{?dist} License: MIT URL: http://banisterfiend.wordpress.com Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem -# Fix Fixnum/Bignum deprecated warning for Ruby 2.4.0. -# https://github.com/banister/method_source/commit/05ce7fc -Patch0: rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings.patch -Patch1: rubygem-method_source-0.8.2-fix-fixnum-bignum-warnings-tests.patch - BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby -BuildRequires: %{_bindir}/bacon +BuildRequires: rubygem(rspec) BuildArch: noarch %description @@ -33,14 +28,12 @@ BuildArch: noarch Documentation for %{name} %prep -%setup -q -c -T -%gem_install -n %{SOURCE0} - -pushd .%{gem_instdir} -%patch0 -p1 -popd +%setup -q -n %{gem_name}-%{version} %build +gem build ../%{gem_name}-%{version}.gemspec +%gem_install + %install mkdir -p %{buildroot}%{gem_dir} @@ -49,10 +42,7 @@ cp -a .%{gem_dir}/* \ %check pushd .%{gem_instdir} - -cat %{PATCH1} | patch -p1 - -bacon test/test.rb +rspec spec popd @@ -68,11 +58,16 @@ popd %doc %{gem_docdir} %{gem_instdir}/Gemfile %doc %{gem_instdir}/README.markdown +%doc %{gem_instdir}/CHANGELOG.md %{gem_instdir}/Rakefile %{gem_instdir}/method_source.gemspec -%{gem_instdir}/test +%{gem_instdir}/spec %changelog +* Fri Oct 30 04:22:11 CET 2020 Pavel Valena - 1.0.0-1 +- Update to method_source 1.0.0. + Resolves: rhbz#1495844 + * Wed Jul 29 2020 Fedora Release Engineering - 0.8.2-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 2c7bc77..db0a6fa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (method_source-0.8.2.gem) = 44cf12bf0e47101f4e91b91b62c54e5403c827be5999b739a930e74c4449861a254631935f6a60430912316767fcc74e3f947075b0b0d994dc864bfdb935af1e +SHA512 (method_source-1.0.0.gem) = d3a2dace01d987203d0520583120bfe08812237602421efc3ec7ff8054f2403b0aac13f15b8b91dfdb6e6679a519f707ede67ea6fed72cd8242edacc828a9caa