honeybadger-io / honeybadger-ruby

Ruby gem for reporting errors to honeybadger.io
https://docs.honeybadger.io/lib/ruby/
MIT License
251 stars 145 forks source link

docs: correct spelling, YARD formatting #604

Closed olleolleolle closed 3 months ago

olleolleolle commented 3 months ago

This tries to format the example to hold lines together, and using an indent level.

I saw that the first code line wasn't understood by YARD.

Screenshots: After this change

The module, I could not get it to render highlighting:

image

The regular class worked per normal:

image

Screenshots: Before this change

image

image

stympy commented 3 months ago

Thanks! I'll get this merged once I get our test matrix cleaned up.

zverok commented 3 months ago

The module, I could not get it to render highlighting

(Sorry, just passed by)

The highlighting usually not turned on when the Ruby is invalid. The example is not a valid Ruby, in particular this line:

metric_attributes { foo: bar }
# SyntaxError ((irb):3: syntax error, unexpected ':', expecting '}')
# metric_attributes { foo: bar }
#                        ^

...because it is interpreted as a method receiving block (not a hash), and foo: bar is invalid block contents.

For all I know, this is the only ways to write this:

metric_attributes({ foo: bar })
# or just
metric_attributes(foo: bar)
stympy commented 3 months ago

@zverok Thanks!

olleolleolle commented 3 months ago

@zverok ❤️ Thanks, and good to see you!