Skip to content

SSH#send and Telnet#send collide with Ruby core method send #3720

@robertcheramy

Description

@robertcheramy

Is your feature request related to a problem? Please describe.
While refactoring SSH and SCP (#3597), I wanted to declare send as an abstract method in Input:

    # Methods to be implemented in subclasses
    # Send data (String)
    def send(_data)
      raise NotImplementedError, "Subclasses might implement send"
    end

This collides with unit tests using send to call a private method:

@http.send("get_uri", path)

send is implemented in ssh (

def send(data)
if Oxidized.config.input.debug?
@log.puts "sent data #{data.dump}"
@log.flush
end
@ses.send_data data
end
) and telnet, and heavily used in models:

  expect /Press any key to continue$/ do
    send ' '
    ""
  end

Describe the solution you'd like
Naming a method send while it is a core method of ruby seems problematic to me.
Just renaming send in the models is not a good idea, as it will probably break a lot of custom models out there.

I propose following steps:

  • Document the problem (this issue)
  • discuss/collect opinions about this (this issue)
  • If we agree on renaming send, start a transition phase

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions