Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ end

group :test do
gem 'cztop'
gem 'rbczmq'
end
4 changes: 1 addition & 3 deletions ci/Dockerfile.main.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM iruby-test-base:ruby-<%= ruby_version %>

RUN gem install cztop \
&& gem install rbczmq -- --with-system-libs

RUN gem install cztop
RUN mkdir -p /iruby
ADD . /iruby
WORKDIR /iruby
Expand Down
6 changes: 1 addition & 5 deletions lib/iruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
begin
require 'iruby/session/cztop'
rescue LoadError
begin
require 'iruby/session/rbczmq'
rescue LoadError
STDERR.puts "Please install ffi-rzmq or cztop before running iruby. See README."
end
STDERR.puts "Please install ffi-rzmq or cztop before running iruby. See README."
end
end
else
Expand Down
72 changes: 0 additions & 72 deletions lib/iruby/session/rbczmq.rb

This file was deleted.

2 changes: 0 additions & 2 deletions lib/iruby/session_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ def make_rep_socket(protocol, host, port)

require_relative 'session_adapter/ffirzmq_adapter'
require_relative 'session_adapter/cztop_adapter'
require_relative 'session_adapter/rbczmq_adapter'
require_relative 'session_adapter/pyzmq_adapter'

def self.select_adapter_class(name=nil)
classes = {
'ffi-rzmq' => SessionAdapter::FfirzmqAdapter,
'cztop' => SessionAdapter::CztopAdapter,
'rbczmq' => SessionAdapter::RbczmqAdapter,
# 'pyzmq' => SessionAdapter::PyzmqAdapter
}
if (name ||= ENV.fetch('IRUBY_SESSION_ADAPTER', nil))
Expand Down
33 changes: 0 additions & 33 deletions lib/iruby/session_adapter/rbczmq_adapter.rb

This file was deleted.

2 changes: 1 addition & 1 deletion run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -ex

export PYTHON=python3

ADAPTERS="cztop rbczmq ffi-rzmq pyzmq"
ADAPTERS="cztop ffi-rzmq pyzmq"

for adapter in $ADAPTERS; do
export IRUBY_TEST_SESSION_ADAPTER_NAME=$adapter
Expand Down
37 changes: 0 additions & 37 deletions test/iruby/session_adapter/rbczmq_adapter_test.rb

This file was deleted.

55 changes: 12 additions & 43 deletions test/iruby/session_adapter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,23 @@ def load_requirements
refute subclass.available?
end

def test_select_adapter_class_with_rbczmq
IRuby::SessionAdapter::RbczmqAdapter.stub :available?, true do
IRuby::SessionAdapter::CztopAdapter.stub :available?, false do
IRuby::SessionAdapter::FfirzmqAdapter.stub :available?, false do
IRuby::SessionAdapter::PyzmqAdapter.stub :available?, false do
cls = IRuby::SessionAdapter.select_adapter_class
assert_equal IRuby::SessionAdapter::RbczmqAdapter, cls
end
end
end
end
end

def test_select_adapter_class_with_cztop
IRuby::SessionAdapter::CztopAdapter.stub :available?, true do
IRuby::SessionAdapter::RbczmqAdapter.stub :available?, false do
IRuby::SessionAdapter::FfirzmqAdapter.stub :available?, false do
IRuby::SessionAdapter::PyzmqAdapter.stub :available?, false do
cls = IRuby::SessionAdapter.select_adapter_class
assert_equal IRuby::SessionAdapter::CztopAdapter, cls
end
IRuby::SessionAdapter::FfirzmqAdapter.stub :available?, false do
IRuby::SessionAdapter::PyzmqAdapter.stub :available?, false do
cls = IRuby::SessionAdapter.select_adapter_class
assert_equal IRuby::SessionAdapter::CztopAdapter, cls
end
end
end
end

def test_select_adapter_class_with_ffirzmq
IRuby::SessionAdapter::FfirzmqAdapter.stub :available?, true do
IRuby::SessionAdapter::RbczmqAdapter.stub :available?, false do
IRuby::SessionAdapter::CztopAdapter.stub :available?, false do
IRuby::SessionAdapter::PyzmqAdapter.stub :available?, false do
cls = IRuby::SessionAdapter.select_adapter_class
assert_equal IRuby::SessionAdapter::FfirzmqAdapter, cls
end
IRuby::SessionAdapter::CztopAdapter.stub :available?, false do
IRuby::SessionAdapter::PyzmqAdapter.stub :available?, false do
cls = IRuby::SessionAdapter.select_adapter_class
assert_equal IRuby::SessionAdapter::FfirzmqAdapter, cls
end
end
end
Expand All @@ -54,30 +37,16 @@ def test_select_adapter_class_with_ffirzmq
def test_select_adapter_class_with_pyzmq
skip "pyzmq adapter is disabled"
IRuby::SessionAdapter::PyzmqAdapter.stub :available?, true do
IRuby::SessionAdapter::RbczmqAdapter.stub :available?, false do
IRuby::SessionAdapter::CztopAdapter.stub :available?, false do
IRuby::SessionAdapter::FfirzmqAdapter.stub :available?, false do
cls = IRuby::SessionAdapter.select_adapter_class
assert_equal IRuby::SessionAdapter::PyzmqAdapter, cls
end
IRuby::SessionAdapter::CztopAdapter.stub :available?, false do
IRuby::SessionAdapter::FfirzmqAdapter.stub :available?, false do
cls = IRuby::SessionAdapter.select_adapter_class
assert_equal IRuby::SessionAdapter::PyzmqAdapter, cls
end
end
end
end

def test_select_adapter_class_with_env
with_env('IRUBY_SESSION_ADAPTER' => 'rbczmq') do
IRuby::SessionAdapter::RbczmqAdapter.stub :available?, true do
assert_equal IRuby::SessionAdapter::RbczmqAdapter, IRuby::SessionAdapter.select_adapter_class
end

IRuby::SessionAdapter::RbczmqAdapter.stub :available?, false do
assert_raises IRuby::SessionAdapterNotFound do
IRuby::SessionAdapter.select_adapter_class
end
end
end

with_env('IRUBY_SESSION_ADAPTER' => 'cztop') do
IRuby::SessionAdapter::CztopAdapter.stub :available?, true do
assert_equal IRuby::SessionAdapter::CztopAdapter, IRuby::SessionAdapter.select_adapter_class
Expand Down
12 changes: 4 additions & 8 deletions test/iruby/session_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ def test_new_with_session_adapter
adapter_class = case adapter_name
when 'cztop'
IRuby::SessionAdapter::CztopAdapter
when 'rbczmq'
IRuby::SessionAdapter::RbczmqAdapter
when 'ffi-rzmq'
IRuby::SessionAdapter::FfirzmqAdapter
when 'pyzmq'
Expand All @@ -39,12 +37,10 @@ def test_new_with_session_adapter

def test_without_any_session_adapter
IRuby::SessionAdapter::CztopAdapter.stub :available?, false do
IRuby::SessionAdapter::RbczmqAdapter.stub :available?, false do
IRuby::SessionAdapter::FfirzmqAdapter.stub :available?, false do
IRuby::SessionAdapter::PyzmqAdapter.stub :available?, false do
assert_raises IRuby::SessionAdapterNotFound do
IRuby::Session.new(@session_config)
end
IRuby::SessionAdapter::FfirzmqAdapter.stub :available?, false do
IRuby::SessionAdapter::PyzmqAdapter.stub :available?, false do
assert_raises IRuby::SessionAdapterNotFound do
IRuby::Session.new(@session_config)
end
end
end
Expand Down