[rubygem-shoulda-context] Initial package (shoulda-context 1.1.5)

Ken Dreyer ktdreyer at fedoraproject.org
Tue Sep 3 17:26:59 UTC 2013


commit 1013f6af4c7c303d4504e10bc453b419f7897878
Author: Ken Dreyer <ktdreyer at ktdreyer.com>
Date:   Tue Sep 3 11:23:54 2013 -0600

    Initial package (shoulda-context 1.1.5)
    
    Review request at https://bugzilla.redhat.com/1002692

 .gitignore                   |    1 +
 rubygem-shoulda-context.spec |  119 ++++++++++++++++++++++++++++++++++++++++++
 sources                      |    1 +
 3 files changed, 121 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..312cb43 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/shoulda-context-1.1.5.gem
diff --git a/rubygem-shoulda-context.spec b/rubygem-shoulda-context.spec
new file mode 100644
index 0000000..b0481a6
--- /dev/null
+++ b/rubygem-shoulda-context.spec
@@ -0,0 +1,119 @@
+%global gem_name shoulda-context
+
+Name: rubygem-%{gem_name}
+Version: 1.1.5
+Release: 1%{?dist}
+Summary: Context framework extracted from Shoulda
+Group: Development/Languages
+License: MIT
+URL: https://github.com/thoughtbot/shoulda-context
+Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
+Requires: ruby(release)
+Requires: ruby(rubygems)
+BuildRequires: ruby(release)
+BuildRequires: rubygems-devel
+BuildRequires: ruby
+BuildRequires: rubygem(rails)
+BuildRequires: rubygem(mocha)
+BuildRequires: rubygem(test-unit)
+BuildArch: noarch
+Provides: rubygem(%{gem_name}) = %{version}
+
+%description
+Shoulda's contexts make it easy to write understandable and maintainable
+tests for Test::Unit. It's fully compatible with your existing tests in
+Test::Unit, and requires no retooling to use.
+
+Refer to the shoulda gem if you want to know more about using shoulda
+with Rails or 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
+
+# Fix wrong-file-end-of-line-encoding for rpmlint
+sed -i 's/\r$//' MIT-LICENSE
+# Remove /usr/bin/env from shebang so RPM doesn't consider this a dependency
+sed -i 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' bin/convert_to_should_syntax
+# Remove zero-length developer-only file
+rm test/fake_rails_root/vendor/plugins/.keep
+sed -i 's|"test/fake_rails_root/vendor/plugins/.keep",||' %{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
+
+# remove unecessary gemspec
+pushd .%{gem_instdir}
+  rm %{gem_name}.gemspec
+popd
+
+%install
+mkdir -p %{buildroot}%{gem_dir}
+cp -pa .%{gem_dir}/* \
+        %{buildroot}%{gem_dir}/
+
+mkdir -p %{buildroot}%{_bindir}
+cp -pa .%{_bindir}/* \
+        %{buildroot}%{_bindir}/
+
+find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
+
+%check
+pushd .%{gem_instdir}
+  # The tests currently require test-unit, and will fail with minitest.  On
+  # Fedora > 19, minitest gets installed from the other buildrequires, so we
+  # cannot avoid having minitest in the build root.
+  # The long-term solution is to port shoulda-context to work with minitest.
+  # https://github.com/thoughtbot/shoulda-context/issues/33
+  %if 0%{?fedora} <= 19
+    testrb -Ilib:test test/shoulda/*_test.rb
+  %else
+    echo "tests do not work with minitest. Skipping."
+  %endif
+popd
+
+%files
+%dir %{gem_instdir}
+%doc %{gem_instdir}/MIT-LICENSE
+%exclude %{gem_instdir}/.*
+%{_bindir}/convert_to_should_syntax
+%{gem_instdir}/bin
+%{gem_libdir}
+%exclude %{gem_cache}
+%{gem_spec}
+%{gem_instdir}/gemfiles
+
+%files doc
+%doc %{gem_docdir}
+%doc %{gem_instdir}/README.md
+%doc %{gem_instdir}/CONTRIBUTING.md
+%{gem_instdir}/Appraisals
+%{gem_instdir}/Rakefile
+%{gem_instdir}/Gemfile
+%{gem_instdir}/init.rb
+%{gem_instdir}/rails/init.rb
+%{gem_instdir}/tasks
+%{gem_instdir}/test
+
+%changelog
+* Tue Aug 27 2013 Ken Dreyer <ktdreyer at ktdreyer.com> - 1.1.5-1
+- Initial package
diff --git a/sources b/sources
index e69de29..fafdf4d 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+e16c4038899f3c529f02aa8de0630e36  shoulda-context-1.1.5.gem


More information about the scm-commits mailing list