Skip to content

EXAMPLES.md corrections#527

Merged
mattbrictson merged 6 commits into
capistrano:masterfrom
JasonPoll:example-updates
Jan 5, 2024
Merged

EXAMPLES.md corrections#527
mattbrictson merged 6 commits into
capistrano:masterfrom
JasonPoll:example-updates

Conversation

@JasonPoll

Copy link
Copy Markdown
Contributor

While reviewing and testing @mattbrictson 's #524, I found myself referencing EXAMPLES.md and noted some inaccuracies.

Hoping it's ok to open this PR without a corresponding issue discussing this first.

Comment thread EXAMPLES.md
something like "echo(:cat, '...?...', '> /etc/sudoers.d/yolo')".

**Note:** The `upload!()` method doesn't honor the values of `within()`, `as()`
etc, this will be improved as the library matures, but we're not there yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This (and the above) appeared to be inaccurate based on my testing of #524.

Comment thread EXAMPLES.md
```ruby
# The default format is pretty, which outputs colored text
SSHKit.config.format = :pretty
SSHKit.config.use_format :pretty

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These appeared to have never been updated in 2cb6326.

Comment thread EXAMPLES.md
class MyFormatter < SSHKit::Formatter::Abstract
def write(obj)
case obj.is_a? SSHKit::Command
if obj.is_a? SSHKit::Command

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At least with Ruby 3.2.2, this case produced an error:

SyntaxError: unexpected `end', expecting `when'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch!

@mattbrictson mattbrictson added the 📚 Docs Improves documentation label Dec 30, 2023

@mattbrictson mattbrictson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this! One small change requested; see comments

Comment thread EXAMPLES.md Outdated
Comment thread EXAMPLES.md
class MyFormatter < SSHKit::Formatter::Abstract
def write(obj)
case obj.is_a? SSHKit::Command
if obj.is_a? SSHKit::Command

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch!

@mattbrictson
mattbrictson enabled auto-merge (squash) January 4, 2024 01:43
@mattbrictson
mattbrictson merged commit fe6ac24 into capistrano:master Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 Docs Improves documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants