Code Monkey home page Code Monkey logo

Comments (5)

mattbrictson avatar mattbrictson commented on June 20, 2024

Thanks for the suggestion! I'm interested in this idea.

What do you think the configuration syntax for this would look like? Is it something the user will put in their Capfile or deploy.rb?

from airbrussh.

mattbrictson avatar mattbrictson commented on June 20, 2024

Is it something the user will put in their Capfile or deploy.rb?

Actually, I guess the answer is "neither" since this is intended for users who are not using Capistrano. In that case could you provide an example of what this configuration would look like with plain SSHKit or something like runbook?

from airbrussh.

pblesi avatar pblesi commented on June 20, 2024

Right. So this is how Runbook currently initializes Airbrussh through SSHKit:

https://github.com/braintree/runbook/blob/4a0f0770a8a2a7be135cf13ee435d981b5975a06/lib/runbook/configuration.rb#L92-L96

If Airbrussh took a context option as part of its format options, then this would be a way to configure the context. This class would default to Airbrussh::Rake::Context. Another class could be set that adheres to the specified interface (current_task_name, register_new_command, and position).

I believe the configuration could analogously be applied to the set :format_options interface used by capistrano:

https://github.com/mattbrictson/airbrussh#configuration

The syntax in the Airbrussh::Formatter initializer case would be:

      ssh_kit.output = Airbrussh::Formatter.new(
        $stdout,
        banner: nil,
        command_output: true,
        context: Runbook::Airbrussh::Context
      )

And in the Capistrano case would be:

set :format_options, color: false, truncate: 80, context: CustomAirbrusshContext

I'd be happy to throw together a PR

from airbrussh.

mattbrictson avatar mattbrictson commented on June 20, 2024

Makes sense. Thanks for the writeup.

I'd be happy to throw together a PR

Yes please! 🙏

from airbrussh.

mattbrictson avatar mattbrictson commented on June 20, 2024

Fixed via #131

from airbrussh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.