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

Warnings rush after upgrade to version 0.4.0 #10

Closed
take-five opened this issue May 6, 2015 · 4 comments
Closed

Warnings rush after upgrade to version 0.4.0 #10

take-five opened this issue May 6, 2015 · 4 comments
Milestone

Comments

@take-five
Copy link

Hello, hope you're well.

I used 0.3.0 version of your gem in my projects and everything seemed to be fine, but after upgrade I began to get tons of warnings:

/Users/amikhailov/.rvm/gems/ruby-2.1.5/gems/airbrussh-0.4.0/lib/airbrussh/formatter.rb:230: warning: Capistrano::Configuration::Server::Properties#respond_to?(:marshal_dump) is old fashion which takes only one parameter
/Users/amikhailov/.rvm/gems/ruby-2.1.5/gems/capistrano-3.1.0/lib/capistrano/configuration/server.rb:81: warning: respond_to? is defined here
/Users/amikhailov/.rvm/gems/ruby-2.1.5/gems/airbrussh-0.4.0/lib/airbrussh/formatter.rb:230: warning: Capistrano::Configuration::Server::Properties#respond_to?(:_dump) is old fashion which takes only one parameter
/Users/amikhailov/.rvm/gems/ruby-2.1.5/gems/capistrano-3.1.0/lib/capistrano/configuration/server.rb:81: warning: respond_to? is defined here

After digging into a code I've found out that these warnings are generated by this method in Airbrussh::Formatter:

    def deep_copy(obj)
      Marshal.load(Marshal.dump(obj))
    end

After that I've looked into Capistrano code:

        def respond_to?(method)
          @properties.has_key?(method)
        end

Obviously, these warnings come from old Capistrano which is not suited well to new ruby. I'm not certain if they fixed this in newer versions however. Nevertheless I cannot upgrade to newer Capistrano at this moment (capistrano comes as dependency of internal gem).

I know it is not your fault but maybe there is another way to implement deep_copy stuff having in mind some legacy code (like old capistrano, for instance)?

@robd
Copy link
Contributor

robd commented May 6, 2015

Hi @take-five

Thanks for reporting this issue. We are in the process of fixing this. The need to deep copy is now removed in SSHKit master and hopefully @mattbrictson will get a chance to remove the deep_copy method from Airbrussh at some point soon.

@mattbrictson Would it be helpful for me me to do a PR for this?

@mattbrictson mattbrictson added this to the 0.4.1 milestone May 6, 2015
@mattbrictson
Copy link
Owner

Thanks for the bug report! I missed this one since I had not tested against older Capistrano.

In any case, as @robd mentioned, deep_copy is no longer needed now that SSHKit master was updated earlier today with a fix for the underlying issue.

I've removed deep_copy and will release airbrussh 0.4.1 in the next few minutes.

@mattbrictson
Copy link
Owner

Fixed in 66271b1.

@take-five
Copy link
Author

Thanks for quick fixing this, works like a charm now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants