Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: adhearsion/adhearsion-drb
base: 8aebe8dc8a
...
head fork: adhearsion/adhearsion-drb
compare: 3e7c9198e5
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 2 contributors
View
2  .gitignore
@@ -3,3 +3,5 @@
Gemfile.lock
pkg/*
vendor/ruby
+*.swp
+*.swo
View
6 Guardfile
@@ -0,0 +1,6 @@
+guard 'rspec', :version => 2, :cli => '--format documentation' do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec/" }
+end
+
View
1  adhearsion-drb.gemspec
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "rspec", "~> 2.7.0"
s.add_development_dependency "flexmock"
+ s.add_development_dependency "guard-rspec"
s.add_development_dependency "rake", ">= 0.9.2"
end
View
1  lib/adhearsion/drb/plugin.rb
@@ -13,6 +13,7 @@ class Plugin < Adhearsion::Plugin
config :adhearsion_drb do
host "localhost", :desc => "DRb service host"
port 9050 , :desc => "DRb service port"
+ shared_object nil, :desc => "Object to share over DRb"
desc "Access Control List configuration for the DRb service"
acl {
View
4 lib/adhearsion/drb/plugin/service.rb
@@ -22,7 +22,7 @@ def start
##
# Stop the DRb service
def stop
- logger.info "Stoping DRb on #{config.host}:#{config.port}"
+ logger.info "Stopping DRb on #{config.host}:#{config.port}"
DRb.stop_service
end
@@ -36,7 +36,7 @@ def config
# Creates a plain object and injects the Adhearsion RPC methods configured via plugins
# @return [Object]
def create_drb_door
- Plugin.add_rpc_methods Object.new
+ config[:shared_object]
end
##
View
11 spec/adhearsion/drb/plugin/service_spec.rb
@@ -93,8 +93,8 @@
Adhearsion::Logging.silence!
end
- class Blah < Adhearsion::Plugin
- rpc :foo do
+ class Blah
+ def foo
[3,2,1]
end
end
@@ -106,8 +106,9 @@ class Blah < Adhearsion::Plugin
before do
Adhearsion.config.adhearsion_drb.acl.allow = %q<127.0.0.1>
Adhearsion.config.adhearsion_drb.acl.deny = nil
- # define rpc method
- Adhearsion::Plugin.load_plugins
+ Adhearsion.config.adhearsion_drb.shared_object = Blah.new
+
+ Adhearsion::Plugin.init_plugins
end
after do
@@ -124,4 +125,4 @@ class Blah < Adhearsion::Plugin
end
-end
+end

No commit comments for this range

Something went wrong with that request. Please try again.