17 lines
314 B
Plaintext
17 lines
314 B
Plaintext
|
#!/usr/bin/env ruby
|
||
|
|
||
|
require File.join(File.dirname(__FILE__), '_common.rb')
|
||
|
|
||
|
require 'mongo/gridfs'
|
||
|
include XGen::Mongo::GridFS
|
||
|
|
||
|
db = Mongo.new(DEFAULT_HOST, DEFAULT_PORT).db(DEFAULT_DB)
|
||
|
|
||
|
input_file = ARGV[0]
|
||
|
|
||
|
File.open(input_file, "r") { |f|
|
||
|
GridStore.open(db, input_file, "w") { |g|
|
||
|
g.write(f.read)
|
||
|
}
|
||
|
}
|