Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send -> __send__ #36

Closed
wants to merge 4 commits into from
Closed
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
4 changes: 2 additions & 2 deletions lib/net/ssh/authentication/key_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ def load_identities(identities, ask_passphrase)
{ :public_key => key, :from => :file, :file => identity[:file] }
when :privkey_file
private_key = KeyFactory.load_private_key(identity[:file], options[:passphrase], ask_passphrase)
key = private_key.send(:public_key)
key = private_key.__send__(:public_key)
{ :public_key => key, :from => :file, :file => identity[:file], :key => private_key }
when :data
private_key = KeyFactory.load_data_private_key(identity[:data], options[:passphrase], ask_passphrase)
key = private_key.send(:public_key)
key = private_key.__send__(:public_key)
{ :public_key => key, :from => :key_data, :data => identity[:data], :key => private_key }
else
identity
Expand Down
4 changes: 2 additions & 2 deletions lib/net/ssh/buffer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def self.from(*args)
if type == :raw
buffer.append(value.to_s)
elsif Array === value
buffer.send("write_#{type}", *value)
buffer.__send__("write_#{type}", *value)
else
buffer.send("write_#{type}", value)
buffer.__send__("write_#{type}", value)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/net/ssh/connection/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def dispatch_incoming_packets
raise Net::SSH::Exception, "unexpected response #{packet.type} (#{packet.inspect})"
end

send(MAP[packet.type], packet)
__send__(MAP[packet.type], packet)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/net/ssh/packet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def instantiate!
@named_elements[name.to_sym] = if datatype == :buffer
remainder_as_buffer
else
send("read_#{datatype}")
__send__("read_#{datatype}")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/net/ssh/proxy/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def open(host, port)
end
@command_line = command_line
class << io
def send(data, flag)
def __send__(data, flag)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__send__ shouldn't be overridden here either.

write_nonblock(data)
end

Expand Down
8 changes: 4 additions & 4 deletions lib/net/ssh/test/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def select_for_test(readers=nil, writers=nil, errors=nil, wait=nil)

end; end; end

Net::SSH::BufferedIo.send(:include, Net::SSH::Test::Extensions::BufferedIo)
Net::SSH::Transport::PacketStream.send(:include, Net::SSH::Test::Extensions::PacketStream)
Net::SSH::Connection::Channel.send(:include, Net::SSH::Test::Extensions::Channel)
IO.send(:include, Net::SSH::Test::Extensions::IO)
Net::SSH::BufferedIo.__send__(:include, Net::SSH::Test::Extensions::BufferedIo)
Net::SSH::Transport::PacketStream.__send__(:include, Net::SSH::Test::Extensions::PacketStream)
Net::SSH::Connection::Channel.__send__(:include, Net::SSH::Test::Extensions::Channel)
IO.__send__(:include, Net::SSH::Test::Extensions::IO)
2 changes: 1 addition & 1 deletion lib/net/ssh/test/local_packet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def process(packet)
when TrueClass, FalseClass then :bool
end

actual = packet.send("read_#{type}")
actual = packet.__send__("read_#{type}")
next if expected.nil?
raise "expected #{type} #{expected.inspect} but got #{actual.inspect}" unless expected == actual
end
Expand Down
2 changes: 1 addition & 1 deletion lib/net/ssh/test/script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def gets_channel_close(channel)
# # peek at the next event
# event = script.next(:first)
def next(mode=:shift)
events.send(mode)
events.__send__(mode)
end

# Compare the given packet against the next event in the list. If there is
Expand Down
2 changes: 1 addition & 1 deletion lib/net/ssh/transport/cipher_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def self.get(name, options={})
return IdentityCipher if ossl_name == "none"

cipher = OpenSSL::Cipher::Cipher.new(ossl_name)
cipher.send(options[:encrypt] ? :encrypt : :decrypt)
cipher.__send__(options[:encrypt] ? :encrypt : :decrypt)

cipher.padding = 0
cipher.iv = Net::SSH::Transport::KeyExpander.expand_key(cipher.iv_len, options[:iv], options) if ossl_name != "rc4"
Expand Down
2 changes: 1 addition & 1 deletion lib/net/ssh/transport/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def poll_message(mode=:nonblock, consume_queue=true)
lwarn { "UNIMPLEMENTED: #{packet[:number]}" }

when DEBUG
send(packet[:always_display] ? :fatal : :debug) { packet[:message] }
__send__(packet[:always_display] ? :fatal : :debug) { packet[:message] }

when KEXINIT
algorithms.accept_kexinit(packet)
Expand Down
1 change: 1 addition & 0 deletions lib/sonixlabs-net-ssh.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require 'net/ssh'
10 changes: 5 additions & 5 deletions net-ssh.gemspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
@spec = Gem::Specification.new do |s|
s.name = "net-ssh"
s.rubyforge_project = 'net-ssh'
s.name = "sonixlabs-net-ssh"
s.version = "2.3.0"
s.summary = "Net::SSH: a pure-Ruby implementation of the SSH2 client protocol."
s.description = s.summary + " It allows you to write programs that invoke and interact with processes on remote servers, via SSH2."
s.authors = ["Jamis Buck", "Delano Mandelbaum"]
s.email = ["net-ssh@solutious.com"]
s.homepage = "http://github.com/net-ssh/net-ssh"
s.authors = ["Kazuhiro Yamada"]
s.email = ["sonixlabs@sonix.asia", "yamadakazu45@gmail.com"]
s.homepage = "https://github.com/sonixlabs/net-ssh"

s.extra_rdoc_files = %w[README.rdoc THANKS.rdoc CHANGELOG.rdoc]
s.has_rdoc = true
Expand All @@ -24,6 +23,7 @@
Rakefile
Rudyfile
THANKS.rdoc
lib/sonixlabs-net-ssh.rb
lib/net/ssh.rb
lib/net/ssh/authentication/agent.rb
lib/net/ssh/authentication/constants.rb
Expand Down