Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move Bundler to spec_helper.

  • Loading branch information...
commit a11b3716704a26b6a09898a599a76724e0d1eea8 1 parent a12e344
@bcg authored
View
1  .gitignore
@@ -1,3 +1,4 @@
Gemfile.lock
.bundle
*.gem
+vendor
View
5 CHANGELOG
@@ -1,3 +1,8 @@
+- 0.3.3
+
+ * Yank Bundler out lib/em-mongo.rb and push it into spec/spec_helper.rb
+ * Numerous Rakefile changes
+
- 0.3.2
* Added spec/gem to help with release testing
View
2  Gemfile
@@ -3,7 +3,7 @@ source :gemcutter
gemspec
group :development do
- gem "rspec"
+ gem "rspec", "< 1.3"
gem "em-spec", :git => "https://github.com/mloughran/em-spec.git"
end
View
25 Rakefile
@@ -1,8 +1,4 @@
-require 'rake'
-require 'rake/gempackagetask'
-
-require 'spec/rake/spectask'
require 'fileutils'
require 'tmpdir'
@@ -38,8 +34,12 @@ end
spec = eval(File.read('em-mongo.gemspec'))
-Rake::GemPackageTask.new(spec) do |pkg|
- pkg.gem_spec = spec
+namespace :bundle do
+ task :install do
+ if `bundle check` =~ /bundle install/
+ system("bundle install --path vendor/gems")
+ end
+ end
end
namespace :gem do
@@ -79,8 +79,11 @@ namespace :spec do
print "Testing Rubygems integration ... "
steps =[]
steps << "cd spec/gem"
- steps << "gem uninstall -a em-mongo >/dev/null"
- steps << "gem install #{root_dir}/em-mongo-#{em_mongo_version}.gem >/dev/null"
+
+ if `gem list -i em-mongo` == 'true'
+ steps << "gem uninstall --force -a em-mongo >/dev/null"
+ end
+ steps << "gem install #{root_dir}/em-mongo-#{em_mongo_version}.gem >/dev/null "
steps << "./rubygems.rb"
if system steps.join(" && ")
puts "SUCCESS."
@@ -97,14 +100,14 @@ namespace :spec do
namespace :integration do
desc "default tests"
- task :default do
+ task :default => ['bundle:install'] do
MongoRunner.run do
system "bundle exec spec #{spec.test_files.join(' ')} -t -b -fs -color"
end
end
desc "exhaustive tests"
- task :exhaustive do
+ task :exhaustive => ['bundle:install'] do
MongoRunner.run({:noclean => true}) do
system "bundle exec spec #{spec.test_files.join(' ')} -t -b -fs -color"
end
@@ -114,7 +117,7 @@ namespace :spec do
end
desc "default tests, but don't start mongodb for me"
- task :no_mongo do
+ task :no_mongo => ['bundle:install'] do
system "bundle exec spec #{spec.test_files.join(' ')} -t -b -fs -color"
end
View
2  VERSION
@@ -1 +1 @@
-0.3.2
+0.3.3
View
4 em-mongo.gemspec
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
s.summary = 'An EventMachine driver for MongoDB.'
s.add_dependency 'eventmachine', ['>= 0.12.10']
- s.add_dependency 'bson', ['>= 0.20.1']
- s.add_dependency 'bson_ext', ['>= 0.20.1']
+ s.add_dependency 'bson', ['>= 1.1.3']
+ s.add_dependency 'bson_ext', ['>= 1.1.3']
end
View
12 lib/em-mongo.rb
@@ -1,15 +1,7 @@
begin
- require "rubygems"
- require "bundler"
- Bundler.setup(:default)
+ require "bson_ext"
rescue LoadError
-ensure
- require "eventmachine"
- begin
- require "bson_ext"
- rescue LoadError
- require "bson"
- end
+ require "bson"
end
module EM::Mongo
View
4 spec/gem/Gemfile
@@ -1,3 +1,5 @@
-source "http://rubygems.org"
+source :gemcutter
+gem 'eventmachine'
+gem 'bson'
gem 'em-mongo', :path => '../../'
View
1  spec/gem/bundler.rb
@@ -3,6 +3,7 @@
require "rubygems"
require "bundler"
Bundler.setup(:default)
+require "eventmachine"
require "em-mongo"
$return = -1
View
1  spec/gem/rubygems.rb
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
require "rubygems"
+require "eventmachine"
require "em-mongo"
$return = -1
View
10 spec/spec_helper.rb
@@ -1,3 +1,13 @@
+require "rubygems"
+require "bundler"
+Bundler.setup(:default, :development)
+require "eventmachine"
+begin
+ require "bson_ext"
+rescue LoadError
+ require "bson"
+end
+
require File.expand_path('../lib/em-mongo', File.dirname(__FILE__))
require "em-spec/rspec"
Please sign in to comment.
Something went wrong with that request. Please try again.