[rubygem-bson] Initial import (#707885).

Vít Ondruch vondruch at fedoraproject.org
Mon May 30 06:38:29 UTC 2011


commit b70464cfc231d54fee25197cd3aecb5348b9a7e3
Author: Vít Ondruch <vondruch at redhat.com>
Date:   Thu May 26 11:14:31 2011 +0200

    Initial import (#707885).

 .gitignore                                      |    2 +
 make-bson-test-suite-independent-of-mongo.patch |   64 ++++++++++++++++
 rubygem-bson.spec                               |   90 +++++++++++++++++++++++
 sources                                         |    2 +
 4 files changed, 158 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..4168851 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/bson-tests.tgz
+/bson-1.3.1.gem
diff --git a/make-bson-test-suite-independent-of-mongo.patch b/make-bson-test-suite-independent-of-mongo.patch
new file mode 100644
index 0000000..7935276
--- /dev/null
+++ b/make-bson-test-suite-independent-of-mongo.patch
@@ -0,0 +1,64 @@
+From 008d95b4508565f984b74dfbf036cadfd5b98b9e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch at redhat.com>
+Date: Thu, 26 May 2011 10:13:48 +0200
+Subject: [PATCH] Make bson test suite independent of mongo
+
+diff --git a/test/bson/object_id_test.rb b/test/bson/object_id_test.rb
+index 43082a5..ba1e6b9 100644
+--- a/test/bson/object_id_test.rb
++++ b/test/bson/object_id_test.rb
+@@ -4,9 +4,6 @@ require 'json'
+ 
+ class ObjectIdTest < Test::Unit::TestCase
+ 
+-  include Mongo
+-  include BSON
+-
+   def setup
+     @o = ObjectId.new
+   end
+@@ -65,17 +62,18 @@ class ObjectIdTest < Test::Unit::TestCase
+     assert_equal "BSON::ObjectId('#{@o.to_s}')", @o.inspect
+   end
+ 
+-  def test_save_and_restore
+-    db = standard_connection.db(MONGO_TEST_DB)
+-    coll = db.collection('test')
+-
+-    coll.remove
+-    coll << {'a' => 1, '_id' => @o}
+-
+-    row = coll.find().collect.first
+-    assert_equal 1, row['a']
+-    assert_equal @o, row['_id']
+-  end
++# This test should be moved into Mongo.
++#  def test_save_and_restore
++#    db = standard_connection.db(MONGO_TEST_DB)
++#    coll = db.collection('test')
++#
++#    coll.remove
++#    coll << {'a' => 1, '_id' => @o}
++#
++#    row = coll.find().collect.first
++#    assert_equal 1, row['a']
++#    assert_equal @o, row['_id']
++#  end
+ 
+   def test_from_string
+     hex_str = @o.to_s
+diff --git a/test/bson/timestamp_test.rb b/test/bson/timestamp_test.rb
+index 37cfec3..1e0b406 100644
+--- a/test/bson/timestamp_test.rb
++++ b/test/bson/timestamp_test.rb
+@@ -1,7 +1,6 @@
+ require './test/test_helper'
+ 
+ class TiumestampTest < Test::Unit::TestCase
+-  include Mongo
+ 
+   def test_timestamp_equality
+     t1 = Timestamp.new(5000, 200)
+-- 
+1.7.5.1
+
diff --git a/rubygem-bson.spec b/rubygem-bson.spec
new file mode 100644
index 0000000..8806ee2
--- /dev/null
+++ b/rubygem-bson.spec
@@ -0,0 +1,90 @@
+# Generated from bson-1.3.1.gem by gem2rpm -*- rpm-spec -*-
+%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
+%global gemname bson
+%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
+%global rubyabi 1.8
+
+Summary: Ruby implementation of BSON
+Name: rubygem-%{gemname}
+Version: 1.3.1
+Release: 1%{?dist}
+Group: Development/Languages
+License: ASL 2.0 
+URL: http://www.mongodb.org
+Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
+# Test included in gem are not functional.
+# See https://jira.mongodb.org/browse/RUBY-277 for reference
+Source1: %{gemname}-tests.tgz
+Patch0: make-bson-test-suite-independent-of-mongo.patch
+Requires: ruby(abi) = %{rubyabi}
+Requires: rubygems
+BuildRequires: ruby(abi) = %{rubyabi}
+BuildRequires: rubygems
+BuildRequires: rubygem(shoulda)
+BuildRequires: rubygem(json)
+BuildArch: noarch
+Provides: rubygem(%{gemname}) = %{version}
+
+%description
+A Ruby BSON implementation for MongoDB. For more information about Mongo, see
+http://www.mongodb.org. For more information on BSON, see
+http://www.bsonspec.org.
+
+
+%package doc
+Summary: Documentation for %{name}
+Group: Documentation
+Requires:%{name} = %{version}-%{release}
+
+%description doc
+Documentation for %{name}
+
+
+%prep
+%setup -q -c -T
+mkdir -p .%{gemdir}
+gem install --local --install-dir .%{gemdir} \
+            --bindir .%{_bindir} \
+            --force %{SOURCE0}
+
+pushd .%{geminstdir}
+%patch0 -p1
+popd
+
+%build
+
+%install
+mkdir -p %{buildroot}%{gemdir}
+cp -a .%{gemdir}/* \
+        %{buildroot}%{gemdir}/
+
+mkdir -p %{buildroot}%{_bindir}
+cp -a .%{_bindir}/* \
+        %{buildroot}%{_bindir}/
+
+find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x
+
+%check
+pushd .%{geminstdir}
+tar xzvf %{SOURCE1}
+RUBYOPT=rubygems testrb test/**/*_test.rb
+popd
+
+%files
+%dir %{geminstdir}
+%{_bindir}/b2json
+%{_bindir}/j2bson
+%{geminstdir}/LICENSE.txt
+%{geminstdir}/bin
+%{geminstdir}/lib
+%{gemdir}/cache/%{gemname}-%{version}.gem
+%{gemdir}/specifications/%{gemname}-%{version}.gemspec
+
+%files doc
+%doc %{gemdir}/doc/%{gemname}-%{version}
+%{geminstdir}/test
+
+
+%changelog
+* Wed May 25 2011 Vít Ondruch <vondruch at redhat.com> - 1.3.1-1
+- Initial package
diff --git a/sources b/sources
index e69de29..8a765b7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+de41d40a1f660781f482641190379230  bson-tests.tgz
+4a2ef9e7e979dd821ad35cefa047188d  bson-1.3.1.gem


More information about the scm-commits mailing list