From 0d7cefd87b31e348d48481dd3988bf1fbfb8620d Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Mon, 26 Oct 2009 15:34:45 -0400 Subject: [PATCH] minor: cleaned up gemspecs, docs. --- lib/mongo.rb | 6 ++- lib/mongo/util/server_version.rb | 15 ++++++ lib/mongo/util/support.rb | 5 -- mongo-extensions.gemspec | 14 ++---- mongo-ruby-driver.gemspec | 86 ++++---------------------------- 5 files changed, 33 insertions(+), 93 deletions(-) diff --git a/lib/mongo.rb b/lib/mongo.rb index acf1062..6eaaa0c 100644 --- a/lib/mongo.rb +++ b/lib/mongo.rb @@ -1,11 +1,13 @@ +$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib') + require 'mongo/types/binary' require 'mongo/types/code' require 'mongo/types/dbref' require 'mongo/types/objectid' require 'mongo/types/regexp_of_holding' -require 'mongo/util/conversions' require 'mongo/util/support' +require 'mongo/util/conversions' require 'mongo/util/server_version' require 'mongo/errors' @@ -20,5 +22,5 @@ module Mongo ASCENDING = 1 DESCENDING = -1 - VERSION = "1.15.1" + VERSION = "0.15.1" end diff --git a/lib/mongo/util/server_version.rb b/lib/mongo/util/server_version.rb index 38882ef..226c271 100644 --- a/lib/mongo/util/server_version.rb +++ b/lib/mongo/util/server_version.rb @@ -1,3 +1,18 @@ +# -- +# Copyright (C) 2008-2009 10gen Inc. +# +# 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. +# ++ module Mongo # Simple class for comparing server versions. class ServerVersion diff --git a/lib/mongo/util/support.rb b/lib/mongo/util/support.rb index 7e3adde..9cf7098 100644 --- a/lib/mongo/util/support.rb +++ b/lib/mongo/util/support.rb @@ -13,11 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ++ - -# A hash in which the order of keys are preserved. -# -# Under Ruby 1.9 and greater, this class has no added methods because Ruby's -# Hash already keeps its keys ordered by order of insertion. class Object def returning(value) diff --git a/mongo-extensions.gemspec b/mongo-extensions.gemspec index 740cc5c..1f3233e 100644 --- a/mongo-extensions.gemspec +++ b/mongo-extensions.gemspec @@ -1,21 +1,17 @@ -# We need to list all of the included files because we aren't allowed to use -# Dir[...] in the github sandbox. -PACKAGE_FILES = ['Rakefile', 'mongo-extensions.gemspec', - 'ext/cbson/cbson.c', - 'ext/cbson/extconf.rb'] -TEST_FILES = [] +require 'lib/mongo' Gem::Specification.new do |s| s.name = 'mongo_ext' - s.version = '0.15.1' + s.version = Mongo::VERSION s.platform = Gem::Platform::RUBY s.summary = 'C extensions for the MongoDB Ruby driver' s.description = 'C extensions to accelerate the MongoDB Ruby driver. For more information about Mongo, see http://www.mongodb.org.' s.require_paths = ['ext'] - s.files = PACKAGE_FILES - s.test_files = TEST_FILES + s.files = ['Rakefile', 'mongo-extensions.gemspec'] + s.files += Dir['ext/**/*.rb'] + s.test_files = [] s.has_rdoc = false s.extensions << 'ext/cbson/extconf.rb' diff --git a/mongo-ruby-driver.gemspec b/mongo-ruby-driver.gemspec index aac764b..5af4b22 100644 --- a/mongo-ruby-driver.gemspec +++ b/mongo-ruby-driver.gemspec @@ -1,90 +1,22 @@ -# We need to list all of the included files because we aren't allowed to use -# Dir[...] in the github sandbox. -PACKAGE_FILES = ['README.rdoc', 'Rakefile', 'mongo-ruby-driver.gemspec', - 'bin/bson_benchmark.rb', - 'bin/mongo_console', - 'bin/run_test_script', - 'bin/standard_benchmark', - 'examples/admin.rb', - 'examples/benchmarks.rb', - 'examples/blog.rb', - 'examples/capped.rb', - 'examples/cursor.rb', - 'examples/gridfs.rb', - 'examples/index_test.rb', - 'examples/info.rb', - 'examples/queries.rb', - 'examples/simple.rb', - 'examples/strict.rb', - 'examples/types.rb', - 'lib/mongo/admin.rb', - 'lib/mongo/collection.rb', - 'lib/mongo/connection.rb', - 'lib/mongo/constants.rb', - 'lib/mongo/cursor.rb', - 'lib/mongo/db.rb', - 'lib/mongo/gridfs/chunk.rb', - 'lib/mongo/gridfs/grid_store.rb', - 'lib/mongo/gridfs.rb', - 'lib/mongo/errors.rb', - 'lib/mongo/types/binary.rb', - 'lib/mongo/types/code.rb', - 'lib/mongo/types/dbref.rb', - 'lib/mongo/types/objectid.rb', - 'lib/mongo/types/regexp_of_holding.rb', - 'lib/mongo/util/bson.rb', - 'lib/mongo/util/byte_buffer.rb', - 'lib/mongo/util/conversions.rb', - 'lib/mongo/util/ordered_hash.rb', - 'lib/mongo/util/support.rb', - 'lib/mongo/util/xml_to_ruby.rb', - 'lib/mongo.rb'] -TEST_FILES = ['test/mongo-qa/_common.rb', - 'test/mongo-qa/admin', - 'test/mongo-qa/capped', - 'test/mongo-qa/count1', - 'test/mongo-qa/dbs', - 'test/mongo-qa/find', - 'test/mongo-qa/find1', - 'test/mongo-qa/gridfs_in', - 'test/mongo-qa/gridfs_out', - 'test/mongo-qa/indices', - 'test/mongo-qa/remove', - 'test/mongo-qa/stress1', - 'test/mongo-qa/test1', - 'test/mongo-qa/update', - 'test/test_admin.rb', - 'test/test_bson.rb', - 'test/test_byte_buffer.rb', - 'test/test_chunk.rb', - 'test/test_collection.rb', - 'test/test_connection.rb', - 'test/test_conversions.rb', - 'test/test_cursor.rb', - 'test/test_db.rb', - 'test/test_db_api.rb', - 'test/test_db_connection.rb', - 'test/test_grid_store.rb', - 'test/test_helper.rb', - 'test/test_objectid.rb', - 'test/test_ordered_hash.rb', - 'test/test_threading.rb', - 'test/test_round_trip.rb', - 'test/unit/cursor_test.rb'] +require "lib/mongo" Gem::Specification.new do |s| s.name = 'mongo' - # be sure to change this constant in lib/mongo.rb as well - s.version = '0.15.1' + s.version = Mongo::VERSION s.platform = Gem::Platform::RUBY s.summary = 'Ruby driver for the MongoDB' s.description = 'A Ruby driver for MongoDB. For more information about Mongo, see http://www.mongodb.org.' s.require_paths = ['lib'] - s.files = PACKAGE_FILES - s.test_files = TEST_FILES + + s.files = ['README.rdoc', 'Rakefile', 'mongo-ruby-driver.gemspec', 'LICENSE.txt'] + s.files += Dir['lib/**/*.rb'] + Dir['examples/**/*.rb'] + Dir['bin/**/*.rb'] + s.test_files = Dir['test/**/*.rb'] + + s.has_rdoc = true + s.test_files = Dir['test/**/*.rb'] s.has_rdoc = true s.rdoc_options = ['--main', 'README.rdoc', '--inline-source']