Skip to content

Instantly share code, notes, and snippets.

@pvalena
Created January 18, 2022 12:01
Show Gist options
  • Save pvalena/c4c88fcb11793c96565fe421a91a7ac5 to your computer and use it in GitHub Desktop.
Save pvalena/c4c88fcb11793c96565fe421a91a7ac5 to your computer and use it in GitHub Desktop.
--- rubygem-pundit/.generated.spec 2022-01-18 12:55:40.796950852 +0100
+++ rubygem-pundit/rubygem-pundit.spec 2022-01-18 12:45:00.235341303 +0100
@@ -1,24 +1,19 @@
-Downloaded pundit-2.1.1
-# Generated from pundit-2.1.1.gem by gem2rpm -*- rpm-spec -*-
+# Generated from pundit-0.2.3.gem by gem2rpm -*- rpm-spec -*-
%global gem_name pundit
Name: rubygem-%{gem_name}
Version: 2.1.1
Release: 1%{?dist}
-Summary: OO authorization for Rails
+Summary: Object oriented authorization for Rails
License: MIT
URL: https://github.com/varvet/pundit
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
-# BuildRequires: rubygem(actionpack) >= 3.0.0
-# BuildRequires: rubygem(activemodel) >= 3.0.0
-# BuildRequires: rubygem(pry)
-# BuildRequires: rubygem(rspec) >= 3.0.0
-# BuildRequires: rubygem(rubocop) = 0.74.0
-# BuildRequires: rubygem(simplecov) >= 0.17.0
-# BuildRequires: rubygem(yard)
+BuildRequires: rubygem(activemodel)
+BuildRequires: rubygem(actionpack)
+BuildRequires: rubygem(rspec)
BuildArch: noarch
%description
@@ -37,11 +32,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
@@ -49,35 +40,88 @@
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
+%check
+# We don't need pry
+sed -i -e '/require "pry"/ s/^/#/' \
+ -e '/require "simplecov"/ s/^/#/' \
+ -e '/^SimpleCov\./,/^end/ s/^/#/' \
+ spec/spec_helper.rb
-%check
-pushd .%{gem_instdir}
-# rspec spec
-popd
+rspec spec
%files
%dir %{gem_instdir}
-%exclude %{gem_instdir}/.gitignore
-%exclude %{gem_instdir}/.rubocop.yml
-%exclude %{gem_instdir}/.travis.yml
-%exclude %{gem_instdir}/.yardopts
-%{gem_instdir}/CODE_OF_CONDUCT.md
-%license %{gem_instdir}/LICENSE.txt
%{gem_libdir}
%exclude %{gem_cache}
+%exclude %{gem_instdir}/.*
+%license %{gem_instdir}/LICENSE.txt
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
+%doc %{gem_instdir}/CODE_OF_CONDUCT.md
%doc %{gem_instdir}/CONTRIBUTING.md
-%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
+%{gem_instdir}/Gemfile
%{gem_instdir}/Rakefile
-%{gem_instdir}/pundit.gemspec
+%{gem_instdir}/%{gem_name}.gemspec
%{gem_instdir}/spec
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment