debian/0000755000000000000000000000000012212006400007151 5ustar debian/source/0000755000000000000000000000000012212006400010451 5ustar debian/source/format0000644000000000000000000000001412212006400011657 0ustar 3.0 (quilt) debian/control0000644000000000000000000000200712212006400010553 0ustar Source: ruby-bson Section: ruby Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Cédric Boutillier , Prach Pongpanich Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.3.0~), ruby-activesupport, ruby-mocha, ruby-shoulda, ruby-json Standards-Version: 3.9.4 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-bson.git Vcs-Browser: http://anonscm.debian.org/gitweb?p=pkg-ruby-extras/ruby-bson.git;a=summary Homepage: http://www.mongodb.org XS-Ruby-Versions: all Package: ruby-bson Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ${shlibs:Depends}, ${misc:Depends}, ruby | ruby-interpreter Recommends: ruby-bson-ext Description: Ruby implementation of BSON BSON is a binary-encoded serialization of JSON-like documents. It is a binary form for representing simple data structures and associative arrays. . This library provides an implementation of BSON for the Ruby programming language. debian/rules0000755000000000000000000000101612212006400010227 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby override_dh_auto_install: dh_auto_install rm -rf debian/ruby-bson/usr/bin debian/ruby-bson.docs0000644000000000000000000000002712212006400011742 0ustar # FIXME: READMEs found debian/compat0000644000000000000000000000000212212006400010347 0ustar 7 debian/watch0000644000000000000000000000013512212006400010201 0ustar version=3 http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/bson .*/bson-(.*).tar.gz debian/patches/0000755000000000000000000000000012212006400010600 5ustar debian/patches/remove_rubygems_from_bins.patch0000644000000000000000000000246312212006400017076 0ustar Description: remove use of and messages about rubygems Author: Cédric Boutillier , Prach Pongpanich Forwarded: no Last-Updated: 2013-06-11 --- a/bin/j2bson +++ b/bin/j2bson @@ -15,19 +15,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -require 'rubygems' require 'bson' # Note that, at the moment, this will not properly round-trip # in all cases from the output generated by b2json. -begin require 'json/pure' # broken with 'json/ext' -rescue LoadError - puts "This script requires json/pure. Please install one of the following:" - puts " gem install json_pure" - puts " gem install json" - Process.exit -end # Convert all JSON objects in an IO into BSON. def print_j2bson(io) --- a/bin/b2json +++ b/bin/b2json @@ -15,18 +15,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -require 'rubygems' require 'bson' # Note that this will not properly round-trip in all cases # from the output generated by j2bson. -begin require 'yajl' -rescue LoadError - puts "This script requires yajl. Please install as follows:" - puts " gem install yajl-ruby" - Process.exit -end # Convert all documents in an IO into JSON. def print_b2json(io) debian/patches/add_require_rbconfig.patch0000644000000000000000000000055112212006400015757 0ustar Description: add missing requirement on rbconfig Author: Cédric Boutillier Bug: https://jira.mongodb.org/browse/RUBY-570 Last-Updated: 2013-03-20 --- a/test/bson/bson_test.rb +++ b/test/bson/bson_test.rb @@ -1,6 +1,7 @@ # encoding:utf-8 require 'test_helper' require 'set' +require 'rbconfig' if RUBY_VERSION < '1.9' silently do debian/patches/add_to_bson_code.patch0000644000000000000000000000056112212006400015070 0ustar Description: add code for to_bson_code for Strings, needed for the tests Author: Cédric Boutillier Bug: https://jira.mongodb.org/browse/RUBY-570 Last-Update: 2013-03-20 --- a/test/bson/bson_test.rb +++ b/test/bson/bson_test.rb @@ -761,3 +761,11 @@ end end end + +class String + def to_bson_code + BSON::Code.new(self) + end +end + + debian/patches/series0000644000000000000000000000025012212006400012012 0ustar #add_test_helper.patch #clean_test_helper.patch #add_require_rbconfig.patch #change_require_activesupport.patch #add_to_bson_code.patch remove_rubygems_from_bins.patch debian/patches/clean_test_helper.patch0000644000000000000000000001165512212006400015311 0ustar Description: clean test_helper.rb from stuff not needed for ruby-bson Author: Cédric Boutillier Bug: https://jira.mongodb.org/browse/RUBY-570 Last-Update: 2013-03-20 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,77 +1,63 @@ -require 'rubygems' -# SimpleCov must load before our code - A coverage report summary line will print after each test suite -if RUBY_VERSION >= '1.9.0' && RUBY_ENGINE == 'ruby' - if ENV.key?('COVERAGE') - require 'simplecov' - SimpleCov.start do - add_group "Mongo", 'lib/mongo' - add_group "BSON", 'lib/bson' - add_filter "/test/" - merge_timeout 3600 - command_name ENV['SIMPLECOV_COMMAND_NAME'] if ENV.has_key?('SIMPLECOV_COMMAND_NAME') - end - end -end -gem 'test-unit' # Do NOT remove this line - gem version is needed for Test::Unit::TestCase.shutdown require 'test/unit' -require 'tools/mongo_config' - -class Test::Unit::TestCase - - TEST_DATA = File.join(File.dirname(__FILE__), 'data') - - def ensure_cluster(kind=nil, opts={}) - @@cluster ||= nil - - unless @@cluster - if kind == :rs - cluster_opts = Mongo::Config::DEFAULT_REPLICA_SET.dup - else - cluster_opts = Mongo::Config::DEFAULT_SHARDED_SIMPLE.dup - end - - cluster_opts.merge!(opts) - - dbpath = ENV['DBPATH'] || 'data' - cluster_opts.merge!(:dbpath => dbpath) - - #debug 1, opts - config = Mongo::Config.cluster(cluster_opts) - #debug 1, config - @@cluster = Mongo::Config::ClusterManager.new(config) - - Test::Unit::TestCase.class_eval do - @@force_shutdown = false - - def self.shutdown - if @@force_shutdown || /rake_test_loader/ !~ $0 - @@cluster.stop - @@cluster.clobber - end - end - end - end - - @@cluster.start - instance_variable_set("@#{kind}", @@cluster) - end - - # Generic code for rescuing connection failures and retrying operations. - # This could be combined with some timeout functionality. - def rescue_connection_failure(max_retries=30) - retries = 0 - begin - yield - rescue Mongo::ConnectionFailure => ex - #puts "Rescue attempt #{retries}: from #{ex}" - retries += 1 - raise ex if retries > max_retries - sleep(2) - retry - end - end -end - +require 'bson' +#require 'tools/mongo_config' +# +#class Test::Unit::TestCase +# +# TEST_DATA = File.join(File.dirname(__FILE__), 'data') +# +# def ensure_cluster(kind=nil, opts={}) +# @@cluster ||= nil +# +# unless @@cluster +# if kind == :rs +# cluster_opts = Mongo::Config::DEFAULT_REPLICA_SET.dup +# else +# cluster_opts = Mongo::Config::DEFAULT_SHARDED_SIMPLE.dup +# end +# +# cluster_opts.merge!(opts) +# +# dbpath = ENV['DBPATH'] || 'data' +# cluster_opts.merge!(:dbpath => dbpath) +# +# #debug 1, opts +# config = Mongo::Config.cluster(cluster_opts) +# #debug 1, config +# @@cluster = Mongo::Config::ClusterManager.new(config) +# +# Test::Unit::TestCase.class_eval do +# @@force_shutdown = false +# +# def self.shutdown +# if @@force_shutdown || /rake_test_loader/ !~ $0 +# @@cluster.stop +# @@cluster.clobber +# end +# end +# end +# end +# +# @@cluster.start +# instance_variable_set("@#{kind}", @@cluster) +# end +# +# # Generic code for rescuing connection failures and retrying operations. +# # This could be combined with some timeout functionality. +# def rescue_connection_failure(max_retries=30) +# retries = 0 +# begin +# yield +# rescue Mongo::ConnectionFailure => ex +# #puts "Rescue attempt #{retries}: from #{ex}" +# retries += 1 +# raise ex if retries > max_retries +# sleep(2) +# retry +# end +# end +#end +# def silently warn_level = $VERBOSE $VERBOSE = nil @@ -83,35 +69,23 @@ result end -begin - silently { require 'shoulda' } - silently { require 'mocha/setup' } -rescue LoadError - puts < Bug: https://jira.mongodb.org/browse/RUBY-570 Last-Updated: 2013-03-20 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,204 @@ +require 'rubygems' +# SimpleCov must load before our code - A coverage report summary line will print after each test suite +if RUBY_VERSION >= '1.9.0' && RUBY_ENGINE == 'ruby' + if ENV.key?('COVERAGE') + require 'simplecov' + SimpleCov.start do + add_group "Mongo", 'lib/mongo' + add_group "BSON", 'lib/bson' + add_filter "/test/" + merge_timeout 3600 + command_name ENV['SIMPLECOV_COMMAND_NAME'] if ENV.has_key?('SIMPLECOV_COMMAND_NAME') + end + end +end +gem 'test-unit' # Do NOT remove this line - gem version is needed for Test::Unit::TestCase.shutdown +require 'test/unit' +require 'tools/mongo_config' + +class Test::Unit::TestCase + + TEST_DATA = File.join(File.dirname(__FILE__), 'data') + + def ensure_cluster(kind=nil, opts={}) + @@cluster ||= nil + + unless @@cluster + if kind == :rs + cluster_opts = Mongo::Config::DEFAULT_REPLICA_SET.dup + else + cluster_opts = Mongo::Config::DEFAULT_SHARDED_SIMPLE.dup + end + + cluster_opts.merge!(opts) + + dbpath = ENV['DBPATH'] || 'data' + cluster_opts.merge!(:dbpath => dbpath) + + #debug 1, opts + config = Mongo::Config.cluster(cluster_opts) + #debug 1, config + @@cluster = Mongo::Config::ClusterManager.new(config) + + Test::Unit::TestCase.class_eval do + @@force_shutdown = false + + def self.shutdown + if @@force_shutdown || /rake_test_loader/ !~ $0 + @@cluster.stop + @@cluster.clobber + end + end + end + end + + @@cluster.start + instance_variable_set("@#{kind}", @@cluster) + end + + # Generic code for rescuing connection failures and retrying operations. + # This could be combined with some timeout functionality. + def rescue_connection_failure(max_retries=30) + retries = 0 + begin + yield + rescue Mongo::ConnectionFailure => ex + #puts "Rescue attempt #{retries}: from #{ex}" + retries += 1 + raise ex if retries > max_retries + sleep(2) + retry + end + end +end + +def silently + warn_level = $VERBOSE + $VERBOSE = nil + begin + result = yield + ensure + $VERBOSE = warn_level + end + result +end + +begin + silently { require 'shoulda' } + silently { require 'mocha/setup' } +rescue LoadError + puts < e + if klass.to_s != e.class.to_s + flunk "Expected exception class #{klass} but got #{e.class}.\n #{e.backtrace}" + end + + if message && !e.message.include?(message) + p e.backtrace + flunk "#{e.message} does not include #{message}.\n#{e.backtrace}" + end + else + flunk "Expected assertion #{klass} but none was raised." + end + end +end debian/copyright0000644000000000000000000000174512212006400011113 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: bson Source: https://github.com/mongodb/mongo-ruby-driver Files: * Copyright: 2008-2013 10gen, Inc License: Apache-2.0 Files: debian/* Copyright: 2013 Cédric Boutillier License: Apache-2.0 License: Apache-2.0 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. . On Debian systems, the full text of the Apache License version 2.0 can be found in the file `/usr/share/common-licenses/Apache-2.0'. debian/ruby-bson.examples0000644000000000000000000000002612212006400012627 0ustar bin/b2json bin/j2bson debian/changelog0000644000000000000000000000224412212006400011025 0ustar ruby-bson (1.9.2-1) unstable; urgency=low * Imported Upstream version 1.9.2 -- Prach Pongpanich Thu, 05 Sep 2013 11:47:16 +0700 ruby-bson (1.9.1-1) unstable; urgency=low * New upstream version -- Prach Pongpanich Fri, 12 Jul 2013 19:47:57 +0700 ruby-bson (1.9.0-1) unstable; urgency=low * New upstream version * Remove debian/source/local-options, unapply-patches are default in dpkg-source since 1.16.1 * Refreshed d/patches/remove_rubygems_from_bins.patch * Add myself as uploaders -- Prach Pongpanich Tue, 11 Jun 2013 21:26:14 +0700 ruby-bson (1.8.5-2) unstable; urgency=low * Recommend ruby-bson-ext -- Cédric Boutillier Mon, 13 May 2013 15:08:05 +0200 ruby-bson (1.8.5-1) unstable; urgency=low * New upstream version + tests dropped from the gem version * drop debian/ruby-tests.rb * deactivate patches for tests -- Cédric Boutillier Mon, 13 May 2013 13:38:27 +0200 ruby-bson (1.8.3-1) unstable; urgency=low * Initial release (Closes: #703530) -- Cédric Boutillier Fri, 08 Mar 2013 15:28:28 +0100