Skip to content

Commit

Permalink
Updated to work with the latest bundler.
Browse files Browse the repository at this point in the history
  • Loading branch information
technicalpickles authored and benburkert committed Apr 5, 2010
1 parent 73a2490 commit c3b593b
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pkg
bin
vendor/gems
.bundle
14 changes: 7 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
source :gemcutter

gem 'rack'
gem 'rack-cache'

only :test do
group :test do
gem 'rake'
gem 'sinatra', :require_as => 'sinatra/base'
gem 'rspec', :require_as => 'spec'
gem 'rack-contrib', :require_as => 'rack/contrib'
gem 'sinatra', :require => 'sinatra/base'
gem 'rspec', :require => 'spec'
gem 'rack-contrib', :require => 'rack/contrib'
gem 'ruby-debug'
gem 'bundler'
gem 'mongrel'
gem 'excon'
gem 'em-http-request'
gem 'em-spec', '0.2.0.hedgehog', :require_as => 'em-spec/rspec'
gem 'em-spec', '0.2.1', :require => 'em-spec/rspec'
gem 'typhoeus'
end

disable_system_gems
9 changes: 4 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require "rake/clean"
require "spec/rake/spectask"

$:.unshift File.join(File.dirname(__FILE__), 'lib')
require 'rack/client'
require 'rack/client/version'

Spec::Rake::SpecTask.new(:spec) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
Expand All @@ -27,10 +27,9 @@ spec = Gem::Specification.new do |s|
s.test_files = Dir["spec/**/*"]

require 'bundler'
manifest = Bundler::Environment.load(File.dirname(__FILE__) + '/Gemfile')
manifest.dependencies.each do |d|
next if d.only && d.only.include?('test')
s.add_dependency(d.name, d.version)
manifest = Bundler.setup
manifest.dependencies_for(:default).each do |d|
s.add_dependency(d.name, d.version_requirement)
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/rack/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ class << self
def_delegators :new, :head, :get, :put, :post, :delete
end

VERSION = "0.2.0"

def self.new(*a, &block)
block ||= lambda { run Rack::Client::Handler::NetHTTP }
Rack::Client::Base.new(Rack::Builder.app(&block), *a)
end
end
end

require 'rack/client/version'

require 'rack/client/base'
require 'rack/client/handler'
require 'rack/client/dual_band'
Expand Down
5 changes: 5 additions & 0 deletions lib/rack/client/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Rack
module Client
VERSION = "0.2.0"
end
end
2 changes: 2 additions & 0 deletions spec/handler/typhoeus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
describe Rack::Client::Handler::Excon do

def client
Rack::Client::Handler::Typhoeus # manual autoload :(

hydra = self.hydra
Rack::Client.new { run Rack::Client::Handler::Typhoeus.new("http://localhost:#{server.port}", hydra) }
end
Expand Down
17 changes: 11 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
Bundler.require_env(:test)
$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
require 'rack/client'

require File.expand_path(File.dirname(__FILE__) + "/../lib/rack/client")
require File.expand_path(File.dirname(__FILE__) + '/server_helper')
require File.expand_path(File.dirname(__FILE__) + '/middleware_helper')
require File.expand_path(File.dirname(__FILE__) + '/handler/sync_api_spec')
require File.expand_path(File.dirname(__FILE__) + '/handler/async_api_spec')
require 'rubygems'
require 'spec'
require 'em-spec/rspec'

dir = File.expand_path(File.dirname(__FILE__))
require dir + '/server_helper'
require dir + '/middleware_helper'
require dir + '/handler/sync_api_spec'
require dir + '/handler/async_api_spec'

Spec::Runner.configure do |config|
def server
Expand Down

0 comments on commit c3b593b

Please sign in to comment.