Gemspec file explicitly lists all files, since I can't use find's File.directory? on Github.

This commit is contained in:
Jim Menard 2009-02-12 10:30:21 -05:00
parent 54c62734fc
commit 61309340cc
1 changed files with 72 additions and 55 deletions

View File

@ -1,59 +1,76 @@
# This is a copy of the code in the stdlib file 'find.rb'. GitHub doesn't seem
# to allow me to "require 'find'".
module Find
def find(*paths) # :yield: path
paths.collect!{|d| d.dup}
while file = paths.shift
catch(:prune) do
yield file.dup.taint
next unless File.exist? file
begin
if File.lstat(file).directory? then
d = Dir.open(file)
begin
for f in d
next if f == "." or f == ".."
if File::ALT_SEPARATOR and file =~ /^(?:[\/\\]|[A-Za-z]:[\/\\]?)$/ then
f = file + f
elsif file == "/" then
f = "/" + f
else
f = File.join(file, f)
end
paths.unshift f.untaint
end
ensure
d.close
end
end
rescue Errno::ENOENT, Errno::EACCES
end
end
end
end
PACKAGE_FILES = ['README.rdoc', 'Rakefile', 'mongo-ruby-driver.gemspec',
'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/cursor.rb',
'lib/mongo/db.rb',
'lib/mongo/gridfs/chunk.rb',
'lib/mongo/gridfs/grid_store.rb',
'lib/mongo/gridfs.rb',
'lib/mongo/message/get_more_message.rb',
'lib/mongo/message/insert_message.rb',
'lib/mongo/message/kill_cursors_message.rb',
'lib/mongo/message/message.rb',
'lib/mongo/message/message_header.rb',
'lib/mongo/message/msg_message.rb',
'lib/mongo/message/opcodes.rb',
'lib/mongo/message/query_message.rb',
'lib/mongo/message/remove_message.rb',
'lib/mongo/message/update_message.rb',
'lib/mongo/message.rb',
'lib/mongo/mongo.rb',
'lib/mongo/query.rb',
'lib/mongo/types/binary.rb',
'lib/mongo/types/dbref.rb',
'lib/mongo/types/objectid.rb',
'lib/mongo/types/regexp_of_holding.rb',
'lib/mongo/types/undefined.rb',
'lib/mongo/util/bson.rb',
'lib/mongo/util/byte_buffer.rb',
'lib/mongo/util/ordered_hash.rb',
'lib/mongo/util/xml_to_ruby.rb',
'lib/mongo.rb']
def prune
throw :prune
end
module_function :find, :prune
end
# ================================================================
def self.files_in(dir)
files = []
Find.find(dir) { |path|
next if path =~ /\.DS_Store$/
files << path unless File.directory?(path)
}
files
end
PACKAGE_FILES = ['README.rdoc', 'Rakefile', 'mongo-ruby-driver.gemspec'] +
files_in('bin') + files_in('examples') + files_in('lib')
TEST_FILES = files_in('tests')
TEST_FILES = ['tests/mongo-qa/_common.rb',
'tests/mongo-qa/admin',
'tests/mongo-qa/capped',
'tests/mongo-qa/count1',
'tests/mongo-qa/dbs',
'tests/mongo-qa/find',
'tests/mongo-qa/find1',
'tests/mongo-qa/indices',
'tests/mongo-qa/remove',
'tests/mongo-qa/stress1',
'tests/mongo-qa/test1',
'tests/mongo-qa/update',
'tests/test_admin.rb',
'tests/test_bson.rb',
'tests/test_byte_buffer.rb',
'tests/test_chunk.rb',
'tests/test_cursor.rb',
'tests/test_db.rb',
'tests/test_db_api.rb',
'tests/test_db_connection.rb',
'tests/test_grid_store.rb',
'tests/test_message.rb',
'tests/test_mongo.rb',
'tests/test_objectid.rb',
'tests/test_ordered_hash.rb',
'tests/test_round_trip.rb']
Gem::Specification.new do |s|
s.name = 'mongo'