%global gem_name diffy
Name: rubygem-%{gem_name}
Version: 3.0.7
Release: 4%{?dist}
Summary: A convenient way to diff string in ruby
License: MIT
URL: http://github.com/samg/diffy
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: rubygem(rspec)
BuildArch: noarch
%description
It provides a convenient way to generate a diff from two strings or files.
Instead of reimplementing the LCS diff algorithm Diffy uses battle tested Unix
diff to generate diffs, and focuses on providing a convenient interface,
and getting out of your way.
%package doc
Summary: Documentation for %{name}
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}/
#cleanup
rm -f %{buildroot}%{gem_instdir}/diffy.gemspec
%check
pushd .%{gem_instdir}
rspec -Ilib spec
popd
%files
%dir %{gem_instdir}
%exclude %{gem_instdir}/.*
%license %{gem_instdir}/LICENSE
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG
%doc %{gem_instdir}/CONTRIBUTORS
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/Rakefile
%{gem_instdir}/spec
%changelog
* Wed Jul 22 2015 Ilya Gradina <ilya.gradina@gmail.com> - 3.0.7-4
- changed description
* Tue Jul 21 2015 Ilya Gradina <ilya.gradina@gmail.com> - 3.0.7-3
- execute the test suite in .%%{gem_instdir}
- exclude %%{gem_instdir}
* Mon Jul 20 2015 Ilya Gradina <ilya.gradina@gmail.com> - 3.0.7-2
- add execution test suite
- exclude hidden files
* Sun Jul 19 2015 Ilya Gradina <ilya.gradina@gmail.com> - 3.0.7-1
- Initial package