Skip to content

Instantly share code, notes, and snippets.

@pvalena
Created February 2, 2023 19:11
Show Gist options
  • Save pvalena/6fc6e79fad7ae5a5538b0cea5650d8ff to your computer and use it in GitHub Desktop.
Save pvalena/6fc6e79fad7ae5a5538b0cea5650d8ff to your computer and use it in GitHub Desktop.
--- rubygem-acts_as_list/.generated.spec 2023-02-02 20:02:51.186504002 +0100
+++ rubygem-acts_as_list/rubygem-acts_as_list.spec 2023-02-02 19:55:21.135488932 +0100
@@ -1,17 +1,20 @@
-Downloaded acts_as_list-1.1.0
-# Generated from acts_as_list-1.1.0.gem by gem2rpm -*- rpm-spec -*-
+# Generated from acts_as_list-0.4.0.gem by gem2rpm -*- rpm-spec -*-
%global gem_name acts_as_list
Name: rubygem-%{gem_name}
Version: 1.1.0
Release: 1%{?dist}
-Summary: A gem adding sorting, reordering capabilities to an active_record model, allowing it to act as a list
+Summary: A gem allowing active_record model to act as a list
License: MIT
URL: http://github.com/brendon/acts_as_list
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
-BuildRequires: ruby >= 2.4.7
+BuildRequires: ruby >= 1.9.2
+BuildRequires: rubygem(activerecord)
+BuildRequires: rubygem(mocha)
+BuildRequires: rubygem(sqlite3)
+BuildRequires: rubygem(timecop)
BuildArch: noarch
%description
@@ -32,11 +35,7 @@
%setup -q -n %{gem_name}-%{version}
%build
-# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec
-
-# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
-# by default, so that we can move it into the buildroot in %%install
%gem_install
%install
@@ -45,35 +44,109 @@
%{buildroot}%{gem_dir}/
-
+# Run the test suite
%check
pushd .%{gem_instdir}
-# Run the test suite.
+# Remove Bundler
+sed -i '/bundler/,/^end$/ s/^/#/' test/helper.rb
+
+ruby -Itest -e 'Dir.glob "./test/**/test_*.rb", &method(:require)'
popd
%files
%dir %{gem_instdir}
-%exclude %{gem_instdir}/.gemtest
-%{gem_instdir}/.github
-%exclude %{gem_instdir}/.gitignore
-%exclude %{gem_instdir}/.travis.yml
-%{gem_instdir}/Appraisals
+%exclude %{gem_instdir}/.*
%license %{gem_instdir}/MIT-LICENSE
-%{gem_instdir}/gemfiles
-%{gem_instdir}/init.rb
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
+%{gem_instdir}/Appraisals
%doc %{gem_instdir}/CHANGELOG.md
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
-%{gem_instdir}/acts_as_list.gemspec
%{gem_instdir}/test
+%{gem_instdir}/init.rb
+%{gem_instdir}/gemfiles
+%{gem_instdir}/%{gem_name}.gemspec
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment