Permalink
Browse files

Make it easier to use bson out of git with bundler

Requiring the entirety of the bson libraries in the gemspec can cause
them to establish state before all of the relevant pieces are in
place. In particular, loading bson can cause the bson gem to conclude
that bson_ext isn't available, when in fact its gemspec just hasn't
been parsed yet.
  • Loading branch information...
1 parent e470ab3 commit 2ab9c01a756afb608c77a43c2930aac72626492e @evan-stripe evan-stripe committed Oct 7, 2012
Showing with 7 additions and 7 deletions.
  1. +1 −1 bson.gemspec
  2. +1 −1 bson.java.gemspec
  3. +5 −5 bson_ext.gemspec
View
@@ -1,5 +1,5 @@
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
-require 'bson'
+require 'bson/version'
Gem::Specification.new do |s|
s.name = 'bson'
View
@@ -1,5 +1,5 @@
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
-require 'bson'
+require 'bson/version'
Gem::Specification.new do |s|
s.name = 'bson'
View
@@ -1,18 +1,18 @@
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
-require 'bson'
+require 'bson/version'
-VERSION_HEADER = File.open(File.join(File.dirname(__FILE__), 'ext', 'cbson', 'version.h'), "r")
-VERSION = VERSION_HEADER.read.scan(/VERSION "(\d[^"]+)"/)[0][0]
+BSON_VERSION_HEADER = File.open(File.join(File.dirname(__FILE__), 'ext', 'cbson', 'version.h'), "r")
+BSON_VERSION = BSON_VERSION_HEADER.read.scan(/VERSION "(\d[^"]+)"/)[0][0]
Gem::Specification.new do |s|
s.name = 'bson_ext'
- s.version = VERSION
+ s.version = BSON_VERSION
s.platform = Gem::Platform::RUBY
s.summary = 'C extensions for Ruby BSON.'
s.description = 'C extensions to accelerate the Ruby BSON serialization. For more information about BSON, see http://bsonspec.org. For information about MongoDB, see http://www.mongodb.org.'
s.rubyforge_project = 'nowarning'
- s.require_paths = ['ext']
+ s.require_paths = ['ext/bson_ext']
s.files = ['Rakefile', 'bson_ext.gemspec']
s.files += Dir['ext/**/*.rb'] + Dir['ext/**/*.c'] + Dir['ext/**/*.h']
s.test_files = []

0 comments on commit 2ab9c01

Please sign in to comment.