6a51a1c
%global gem_name crack
stahnma df04e54
stahnma df04e54
Summary: Really simple JSON and XML parsing, ripped from Merb and Rails
6a51a1c
Name: rubygem-%{gem_name}
9f791d2
Version: 0.3.2
9f791d2
Release: 1%{?dist}
stahnma df04e54
Group: Development/Languages
stahnma df04e54
License: MIT
stahnma df04e54
URL: http://github.com/jnunemaker/crack
6a51a1c
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
stahnma df04e54
# Keeping buildroot so I can use the same spec in EPEL5
6a51a1c
Requires: ruby(rubygems)
6a51a1c
Requires: rubygem(bigdecimal)
3eb8e0a
Requires: ruby(release)
6a51a1c
BuildRequires: rubygems-devel
6a51a1c
BuildRequires: rubygem(minitest)
Michael Stahnke 59dc2b5
BuildRequires: rubygem(shoulda)
Michael Stahnke 59dc2b5
BuildRequires: rubygem(jnunemaker-matchy)
6a51a1c
BuildRequires: rubygem(bigdecimal)
stahnma df04e54
BuildArch: noarch
6a51a1c
Provides: rubygem(%{gem_name}) = %{version}
Michael Stahnke c71900e
#BZ 781829
Michael Stahnke c71900e
Epoch: 1
stahnma df04e54
stahnma df04e54
%description
stahnma df04e54
Really simple JSON and XML parsing, ripped from Merb and Rails.
stahnma df04e54
stahnma df04e54
%package doc
stahnma df04e54
Summary: Documentation for %{name}
stahnma df04e54
Group: Documentation
stahnma df04e54
7e2b40f
Requires: %{name} = %{epoch}:%{version}-%{release}
stahnma df04e54
stahnma df04e54
%description doc
stahnma df04e54
This package contains documentation for %{name}.
stahnma df04e54
stahnma df04e54
%prep
stahnma df04e54
stahnma df04e54
%build
stahnma df04e54
stahnma df04e54
%install
stahnma df04e54
rm -rf %{buildroot}
9f791d2
%gem_install -n %{SOURCE0} -d %{buildroot}%{gem_dir}
6a51a1c
rm -f %{buildroot}%{gem_instdir}/.gitignore
6a51a1c
rm -f %{buildroot}%{gem_instdir}/*.gemspec
stahnma df04e54
stahnma df04e54
%check 
6a51a1c
pushd %{buildroot}%{gem_instdir}
stahnma df04e54
9f791d2
# These tests are not going to work in newer Ruby and it doesn't look like
9f791d2
# crack could be fixed.
9f791d2
# http://bugs.ruby-lang.org/issues/4479
9f791d2
sed -i '/a: "2007-01-01 01:12:34 Z"/ s/^/#/' test/json_test.rb
9f791d2
sed -i '/a: "2007-01-01T01:12:34Z"/ s/^/#/' test/json_test.rb
9f791d2
sed -i '/a: "2007-01-01 01:12:34"/ s/^/#/' test/json_test.rb
9f791d2
9f791d2
# Properly catch Psych parsing errors.
9f791d2
# https://github.com/jnunemaker/crack/pull/32
9f791d2
sed -i -r 's/(rescue ArgumentError)( => e)/\1, Psych::SyntaxError\2/' lib/crack/json.rb
9f791d2
9f791d2
# The RUBYOPT temporary fixes "NameError: uninitialized constant
9f791d2
# REXML::Text::Document", until it is fixed in Ruby.
9f791d2
# https://bugs.ruby-lang.org/issues/7961
9f791d2
RUBYOPT=-rrexml/document testrb test/*_test.rb
9f791d2
popd
stahnma df04e54
stahnma df04e54
%files
6a51a1c
%dir %{gem_instdir}
6a51a1c
%doc %{gem_instdir}/LICENSE
6a51a1c
%doc %{gem_instdir}/README.rdoc
6a51a1c
%doc %{gem_instdir}/History
6a51a1c
%{gem_libdir}
9f791d2
%exclude %{gem_cache}
6a51a1c
%{gem_spec}
stahnma df04e54
stahnma df04e54
%files doc
6a51a1c
%{gem_docdir}
6a51a1c
%{gem_instdir}/Rakefile
6a51a1c
%{gem_instdir}/test
stahnma df04e54
stahnma df04e54
%changelog
9f791d2
* Mon Mar 11 2013 Vít Ondruch <vondruch@redhat.com> - 1:0.3.2-1
3eb8e0a
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
9f791d2
- Update to crack 0.3.2.
3eb8e0a
2ebc387
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.3.1-5
2ebc387
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2ebc387
6ee7f35
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.3.1-4
6ee7f35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
6ee7f35
7e2b40f
* Wed Mar 14 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1:0.3.1-3
7e2b40f
- Properly require the main package (with epoch) from the -doc subpackage.
7e2b40f
8a74212
* Wed Mar 07 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1:0.3.1-2
6a51a1c
- Update to 0.3.1
6a51a1c
Michael Stahnke 91fe91f
* Sun Feb 05 2012 <stahnma@fedoraproject.org> - 0.1.8-5
Michael Stahnke c71900e
- Revert back to 0.1.8 as HTTParty can't use crack > 0.1.8
Michael Stahnke c71900e
Michael Stahnke 59dc2b5
* Wed Dec 28 2011 <stahnma@fedoraproject.org> - 0.3.1-1
Michael Stahnke 59dc2b5
- Update to 0.3.1
Michael Stahnke 59dc2b5
- Fix bz #715704
Michael Stahnke 59dc2b5
Michael Stahnke 59dc2b5
* Thu Nov 10 2011 Michael Stahnke <mastahnke@gmail.com> - 0.1.8-3
Michael Stahnke 59dc2b5
- rebuilt
Michael Stahnke 59dc2b5
168513b
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
168513b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
168513b
stahnma df04e54
* Mon Aug 23 2010 Michael Stahnke <stahnma@fedoraproject.org> - 0.1.8-1
stahnma df04e54
- Broke package into main and doc
stahnma df04e54
- Added tests