%global gem_name generator_spec
Name: rubygem-%{gem_name}
Version: 0.9.4
Release: 1%{?dist}
Summary: Test Rails generators with RSpec
Group: Development/Languages
License: MIT
URL: https://github.com/stevehodgkiss/generator_spec
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: rubygem(railties)
BuildRequires: rubygem(rspec)
BuildArch: noarch
%description
Test Rails generators with RSpec.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build
# Create the gem as gem install only works on a gem file
gem build %{gem_name}.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
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
# Run the test suite
%check
pushd .%{gem_instdir}
sed -i "/require 'bundler/ s/^/#/" spec/spec_helper.rb
rspec -rpathname -Ilib spec
popd
%files
%dir %{gem_instdir}
%doc %{gem_instdir}/README.md
%license %{gem_instdir}/MIT-LICENSE
%{gem_libdir}
%{gem_spec}
%exclude %{gem_instdir}/.*
%exclude %{gem_cache}
%files doc
%doc %{gem_docdir}
%exclude %{gem_instdir}/Gemfile
%exclude %{gem_instdir}/Rakefile
%exclude %{gem_instdir}/generator_spec.gemspec
%exclude %{gem_instdir}/spec
%changelog
* Mon Jul 03 2017 Ilya Gradina <ilya.gradina@gmail.com> - 0.9.4-1
- update to 0.9.4
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Sun Mar 13 2016 Ilya Gradina <ilya.gradina@gmail.com> - 0.9.3-4
- changes in files
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Sep 29 2015 Ilya Gradina <ilya.gradina@gmail.com> - 0.9.3-2
- changes in files section
- exclude gemspec from section files doc
- changes in check section
- remove the BR: rubygem(bundler) and rubygem(activesupport)
* Fri Sep 18 2015 Ilya Gradina <ilya.gradina@gmail.com> - 0.9.3-1
- Initial package