Skip to content

Commit

Permalink
+ Basic migration to newest cod
Browse files Browse the repository at this point in the history
  • Loading branch information
kschiess committed Nov 24, 2011
1 parent 4fe65b0 commit b244fa8
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
8 changes: 5 additions & 3 deletions Gemfile
@@ -1,12 +1,14 @@
source "http://rubygems.org"

gem 'beanstalk-client'
gem 'cod'
gem 'cod', :git => 'git@github.com:kschiess/cod.git',
:ref => '0d153a3859215a75eff363d10a2adb477eef6fcd'
gem 'uuid'
gem 'rake'

group :development do
gem 'rspec', '>= 2.1.0'
gem 'flexmock', '>= 0.8.11'
gem 'rspec'
gem 'flexmock'

gem 'guard'
gem 'guard-rspec'
Expand Down
27 changes: 13 additions & 14 deletions Gemfile.lock
@@ -1,25 +1,23 @@
GIT
remote: git@github.com:kschiess/cod.git
revision: 0d153a3859215a75eff363d10a2adb477eef6fcd
ref: 0d153a3859215a75eff363d10a2adb477eef6fcd
specs:
cod (0.4.0)

GEM
remote: http://rubygems.org/
specs:
beanstalk-client (1.1.0)
cod (0.3.1)
uuid (~> 2)
configuration (1.2.0)
diff-lcs (1.1.2)
flexmock (0.9.0)
growl (1.0.3)
guard (0.3.0)
open_gem (~> 1.4.2)
guard (0.8.8)
thor (~> 0.14.6)
guard-rspec (0.1.9)
guard (>= 0.2.2)
launchy (0.3.7)
configuration (>= 0.0.5)
rake (>= 0.8.1)
macaddr (1.0.0)
open_gem (1.4.2)
launchy (~> 0.3.5)
rake (0.9.2)
rake (0.9.2.2)
rb-fsevent (0.3.9)
rspec (2.5.0)
rspec-core (~> 2.5.0)
Expand All @@ -38,11 +36,12 @@ PLATFORMS

DEPENDENCIES
beanstalk-client
cod
flexmock (>= 0.8.11)
cod!
flexmock
growl
guard
guard-rspec
rake
rb-fsevent
rspec (>= 2.1.0)
rspec
uuid
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -4,7 +4,7 @@ require 'rubygems/package_task'

require 'rspec'
require 'rspec/core/rake_task'
Rspec::Core::RakeTask.new
RSpec::Core::RakeTask.new
task :default => :spec

# This task actually builds the gem.
Expand Down
9 changes: 5 additions & 4 deletions lib/zack/client.rb
Expand Up @@ -20,13 +20,14 @@ def initialize(tube_name, opts={})
# These have answers (wait for the server to answer)
@with_answer = opts[:with_answer] || []

@outgoing = Cod.beanstalk(server, tube_name)
@outgoing = Cod.beanstalk(tube_name, server)
unless @with_answer.empty?
@incoming = Cod.beanstalk(server,
UniqueName.new(tube_name))
@incoming = Cod.beanstalk(
UniqueName.new(tube_name),
server)
end

@service = Cod::Client.new(@outgoing, @incoming, 1)
@service = Cod::Service::Client.new(@outgoing, @incoming)
end

def respond_to?(msg)
Expand Down
2 changes: 1 addition & 1 deletion lib/zack/server.rb
Expand Up @@ -8,7 +8,7 @@ class Server < Target
def initialize(tube_name, opts={})
super

channel = Cod.beanstalk(server, tube_name)
channel = Cod.beanstalk(tube_name, server)
@service = Cod::Service.new(channel)
end

Expand Down
2 changes: 0 additions & 2 deletions lib/zack/transparent_proxy.rb
Expand Up @@ -16,7 +16,5 @@ def method_missing(sym, *args, &block)
service.notify [sym, args]
return nil
end
rescue Cod::Channel::TimeoutError
raise Zack::ServiceTimeout, "No response from server in the allowed time."
end
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
@@ -1,4 +1,6 @@

require 'beanstalk-client'

require 'zack'

RSpec.configure do |config|
Expand Down

0 comments on commit b244fa8

Please sign in to comment.