Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base: 8aebe8dc8a
...
compare: 3e7c9198e5
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 2 contributors
2  .gitignore
View
@@ -3,3 +3,5 @@
Gemfile.lock
pkg/*
vendor/ruby
+*.swp
+*.swo
6 Guardfile
View
@@ -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
+
1  adhearsion-drb.gemspec
View
@@ -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
1  lib/adhearsion/drb/plugin.rb
View
@@ -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 {
4 lib/adhearsion/drb/plugin/service.rb
View
@@ -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
##
11 spec/adhearsion/drb/plugin/service_spec.rb
View
@@ -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.